When I build my solution using MSBuild 4 it compiles successfully:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MySolution.sln
Build succeeded.
0 Warning(s) 0 Error(s)
But when I try to do the same using MSBuild 3.5 I get the following error, even though the source is the same and I am using the same libraries and the same version of the .NET Framework.
C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe MySolution.sln
error CS1501: No overload for method 'InitializeClientContextFromStringSid' takes '2' arguments
error CS1501: No overload for method 'GetRoles' takes '0' arguments
The error that I get is related to Authorization Manager (AzMan).
The method 'InitializeClientContextFromStringSid' in the first error belongs to the public interface IAzApplication, a member of Microsoft.Interop.Security.AzRoles.
The method 'GetRoles' in the second error belongs to the public interface IAzClientContext, also a member of Microsoft.Interop.Security.AzRoles.
I am using the methods in the following way:
var clientContext = _azApplication.InitializeClientContextFromStringSid(member, 0);
where the variable member is a string containing the Windows Active Directory SID from an user and _azApplication is of type IAzApplication.
clientContext.GetRoles()
where clientContext is of type IAzClientContext.
Why does my solution builds with MSBuild 4 but not with MSBuild 3.5 even though I'm targeting the same version of the .NET Framework (3.5)?