User1711320758 posted
I have a project that uses the ClaimsPrincipal to get the CurrentUser.Identity.Name. When I run the same piece of code in Visual Studio 2017 the name field is blank.
This is not a .NET Core project but just a regular .NET library. The problem appears only happens in unit test applications and there is no problem when the code executes under IIS for example.
Did something change in the .NET System library that visual studio 2017 uses? I can replicate 100% of the time. If I create a 2015 project the code works perfectly as expected. In 2017 the code returns empty string. Again, this is only
for Test projects but still needed.
The object Im referring to is: ClaimsPrincipal.Current. And the property is
ClaimsPrincipal.Current.Identity.Name.
I found an article indicating that the ClaimsPrincipal changed for .NET core but I did not think it would would matter for regular .NET libraries.
Any suggestions to preserve the same outcome in 2017 as 2015 ?
Thanks,