Error description:
I write a ASP.NET program, I use HttpContext.Current.User.Identity.Name to store users which visit our site. This program runs well when I debug in Visual studio and wee get display the login user successfully. However, the user name cannot be displayed when I run it in IIS 7.0. I'm very confused, why the program runs well at VS but fail at IIS?
Solution:
It's very obviouly that your IIS cannot get the username for the login one. It's because that you enable the anonymouos authentication in your IIS. You should follow some steps as follows:
Firstly, open you IIS confiuation, Open "Authentication" in "IIS" folders. Just like:
