I have this code
public UserProfile spUserProfileGet()
{
// this line throw : Object reference not set to an instance
var user = HttpContext.Current.User.Identity.Name;
//...
}
In my IIS Development setting, I have
Anonymous Authentication : Disabled
Windows Authentication : Enabled
And i am getting
Object reference not set to an instance
Why is that ? I am using this class in many projects before with no problem :/
The HttpContext.Current.User
is NULL
, but why ?