No owin.Environment item was found in the context No owin.Environment item was found in the context asp.net asp.net

No owin.Environment item was found in the context


Most likely it cannot find the OWIN Startup class. The default convention for the Startup class is [AssemblyName].Startup. If you're no longer following that convention you'll need to specify the full name of your Startup class in the Web.Config.

The next release of Microsoft.Owin.Host.SystemWeb package now throws detailed exception messages when the Startup class cannot be found.


I had the exact same error, but as it turned out I had another configuration problem in my web.config. My web.config was missing the attribute defaultLanguage="c#" in the compilation element under system.web.

In this case it will default to VB. So unless you have your Startup class written in VB you should change the default language to C#.

Not correct:

<compilation debug="true" optimizeCompilations="true" targetFramework="4.6.1">

This is correct (unless you use VB):

<compilation debug="true" defaultLanguage="c#" optimizeCompilations="true" targetFramework="4.6.1">


I had the same issue, it was fixed after making sure this line was in web.config:

<add key="owin:AutomaticAppStartup" value="true" />