1.5 KiB
1.5 KiB
Calling CreateDefaultAuthorizationContext with a null argument has changed
Scope
Minor
Version Introduced
4.6
Source Analyzer Status
Available
Change Description
The implementation of the xref:System.IdentityModel.Policy.AuthorizationContext?displayProperty=name returned by a call to the xref:System.IdentityModel.Policy.AuthorizationContext.CreateDefaultAuthorizationContext(System.Collections.Generic.IList{System.IdentityModel.Policy.IAuthorizationPolicy})?displayProperty=name with a null authorizationPolicies argument has changed its implementation in the .NET Framework 4.6.
- Quirked
- Build-time break
Recommended Action
In rare cases, WCF apps that use custom authentication may see behavioral differences. In such cases, the previous behavior can be restored in either of two ways:
- Recompile your app to target an earlier version of the .NET Framework than 4.6. For IIS-hosted services, use the <httpRuntime targetFramework="x.x" /> element to target an earlier version of the .NET Framework.
- Add the following line to the
<appSettings>
section of your app.config file:<add key="appContext.SetSwitch:Switch.System.IdentityModel.EnableCachedEmptyDefaultAuthorizationContext" value="true" />
Affected APIs
M:System.IdentityModel.Policy.AuthorizationContext.CreateDefaultAuthorizationContext(System.Collections.Generic.IList{System.IdentityModel.Policy.IAuthorizationPolicy})
Category
Windows Communication Foundation (WCF)