My project works with MSBuild 4, but not with MSBuild 3.5, although I am targeting the same version of the .NET Framework (3.5)?

When I create my solution using MSBuild 4, it compiles successfully:

C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe MySolution.sln

Assembly completed successfully.

0 Warning(s)
0 Error(s)

But when I try to do the same with MSBuild 3.5, I get the following error, although the source code is the same and I use the same libraries and the same version of the .NET Framework.

C: \ Windows \ Microsoft.NET \ Framework \ v3.5 \ MSBuild.exe MySolution.sln

error CS1501: overload for method 'InitializeClientContextFromStringSid' accepts arguments "2"

error CS1501: overload for method 'GetRoles' accepts arguments '0'

The error I am getting is related to Authorization Manager (AzMan).

'InitializeClientContextFromStringSid' IAzApplication, Microsoft.Interop.Security.AzRoles.

GetRoles IAzClientContext, Microsoft.Interop.Security.AzRoles.

:

var clientContext = _azApplication.InitializeClientContextFromStringSid(member, 0);

member - , SID Windows Active Directory , _azApplication IAzApplication.

clientContext.GetRoles()

clientContext IAzClientContext.

MSBuild 4, MSBuild 3.5, .NET Framework (3.5)?

+3
1

, InitializeClientContextFromStringSid . MSBuild .Net Framework 4.0 #, , MSBuild . , Framework.

HRESULT InitializeClientContextFromStringSid(
  [in]            BSTR SidString,
  [in]            LONG lOptions,
  [in, optional]  VARIANT varReserved,
  [out]           IAzClientContext **ppClientContext
);

GetRoles.

, , 4.0 MSBuild 3.5 Framework, , CLR , , VB.NET . MSBuild 3.5 /, #, , , .

+6

Source: https://habr.com/ru/post/1777683/


All Articles