2

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.

enter image description here

So, maybe it is not reading from Web.config for some reason? Any help is greatly appriciated.

devmet
  • 95
  • 1
  • 8

1 Answers1

1

This is fixed. I saw that the site didn't have references to FormsAuthentication and Anonymousidentificationmodule. I ran aspnet_regiis -i for asp.net 4.0 and now the site works fine.

devmet
  • 95
  • 1
  • 8
  • This is exactly what I needed. I just installed Team Foundation Server 2013 Express, which a) didn't install properly and then b) messed up authentication on IIS 7.5. I would've been hunting around for this for a while, so thanks a lot. – John H Feb 25 '14 at 15:55