We are getting a null reference exception from the following line in iis 7.5
if (!User.Identity.IsAuthenticated)
we are using forms authentication and also have anonymous authentication enabled. This works just fine in iis 7. Following is our configuration in web.config
<authentication mode="Forms">
<forms name=".ASPXAUTH" loginUrl="/Auth/Login" defaultUrl="/" timeout="600" path="/" />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<identity impersonate="true" />
This form authentication option also doesn't show up under iis site authentication configuration for this site. The only options I see there are Anonymous Authentication and ASP.NET Impersonation.
So, maybe it is not reading from Web.config for some reason? Any help is greatly appriciated.