SyntaxFix
Write A Post
Hire A Developer
Questions
Make sure that you have enable windows authentication. If you have anonymous authentication enabled you may be getting a null string.
https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-3.1&tabs=visual-studio