I'm getting this exception when I try to run my website from IIS i.e outside Visual Studio as a proper website.
I'm using <authentication mode="Windows"/>
and I realized I'm not able to get username when I run website from IIS.
Code to get username
string getUserName = HttpContext.Current.User.Identity.Name.ToString();
The (&(objectClass=user)(anr=)) search filter is invalid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The (&(objectClass=user)(anr=)) search filter is invalid.
...
Go to the complete details ...