## Calls to ClaimsIdentity constructors ### Scope Edge ### Version Introduced 4.6.2 ### Source Analyzer Status Investigating ### Change Description Starting with the .NET Framework 4.6.2, there is a change in how constructors with an parameter set the property. If the argument is a object, and the property of that object is not `null`, the property is attached by using the method. In the Framework 4.6.1 and earlier versions, the property is attached as an existing reference. Because of this change, starting with the .NET Framework 4.6.2, the property of the new object is not equal to the property of the constructor's argument. In the .NET Framework 4.6.1 and earlier versions, it is equal. - [X] Quirked - [ ] Build-time break ### Recommended Action If this behavior is undesirable, you can restore the previous behavior by setting the `Switch.System.Security.ClaimsIdentity.SetActorAsReferenceWhenCopyingClaimsIdentity` switch in your application configuration file to `true`. This requires that you add the following to the `` section of your web.config file: ```xml ``` ### Affected APIs - `M:System.Security.Claims.ClaimsIdentity.#ctor(System.Security.Principal.IIdentity)` - `M:System.Security.Claims.ClaimsIdentity.#ctor(System.Security.Principal.IIdentity,System.Collections.Generic.IEnumerable{System.Security.Claims.Claim})` - `M:System.Security.Claims.ClaimsIdentity.#ctor(System.Security.Principal.IIdentity,System.Collections.Generic.IEnumerable{System.Security.Claims.Claim},System.String,System.String,System.String)` ### Category Core