I feel I've got the same problem as described in this thread. I am working on an ASP.NET MVC web application that runs fine locally. When deployed to our Windows Server 2008 with IIS7, however, I get the following error when trying to log in:
No owin.Environment item was found in the context.
This is the line that triggers this error:
return _signInManager ?? HttpContext.GetOwinContext().Get<ApplicationSignInManager>();
I have tried all I could find:
- Adding
<add key="owin:AppStartup" value="My_App.Startup,My-App"/>
toe the web.config. My Application has a hyphen in its name, but that should not be a problem, right? - Adding
<add key="owin:AutomaticAppStartup" value="true"/>
to the web.config. - Adding
<modules runAllManagedModulesForAllRequests="true">
to the web.config. - I verified that
Microsoft.Owin.Host.SystemWeb
is installed and in the bin-folder. - Clearing the ASP.net temporary files.
- The app pool is set to "integrated"
It's working just fine locally. What am I missing?
This is not a duplicate of this thread. I have tried the solution from there (see my #1) to no success. Also, I have not changed the namespace.
Edit One solution is to register the OwinHttpHandler explicitly in the web.config but this had some strange side effects (my CSS and JavaScript are not loaded anymore, Status 404?):
<handlers>
<add name="OWIN" path="*" verb="*" type="Microsoft.Owin.Host.SystemWeb.OwinHttpHandler" />
</handlers>