i feel i've got same problem described in thread. working on asp.net mvc web application runs fine locally. when deployed our windows server 2008 iis7, however, following error when trying log in:
no owin.environment item found in context.
this line triggers error:
return _signinmanager ?? httpcontext.getowincontext().get<applicationsigninmanager>(); i have tried find:
- adding
<add key="owin:appstartup" value="my_app.startup,my-app"/>toe web.config. application has hyphen in name, should not problem, right? - adding
<add key="owin:automaticappstartup" value="true"/>web.config. - adding
<modules runallmanagedmodulesforallrequests="true">web.config. - i verified
microsoft.owin.host.systemwebinstalled , in bin-folder. - clearing asp.net temporary files.
- the app pool set "integrated"
it's working fine locally. what missing?
this not duplicate of this thread. have tried solution there (see #1) no success. also, have not changed namespace.
edit 1 solution register owinhttphandler explicitly in web.config had strange side effects (my css , javascript not loaded anymore, status 404?):
<handlers> <add name="owin" path="*" verb="*" type="microsoft.owin.host.systemweb.owinhttphandler" /> </handlers>
naming convention: katana looks class named startup in namespace matching assembly name or global namespace.
owinstartup attribute: this approach developers take specify startup class. following attribute set startup class teststartup class in startupdemo namespace.
[assembly: owinstartup(typeof(startupdemo.teststartup))] <appsettings> <add key="owin:appstartup" value="startupdemo.productionstartup" /> </appsettings> the following key, explicitly specifies startup class , assembly can used:
<add key="owin:appstartup" value="startupdemo.productionstartup, startupdemo" /> <appsettings> <add key="owin:appstartup" value="productionconfiguration" /> </appsettings> the above markup must used following owinstartup attribute specifies friendly name , causes productionstartup2 class run.
[assembly: owinstartup("productionconfiguration", typeof(startupdemo.productionstartup2))] namespace startupdemo { public class productionstartup { public void configuration(iappbuilder app) { app.run(context => { string t = datetime.now.millisecond.tostring(); return context.response.writeasync(t + " production owin app"); }); } } public class productionstartup2 { public void configuration(iappbuilder app) { app.run(context => { string t = datetime.now.millisecond.tostring(); return context.response.writeasync(t + " 2nd production owin app"); }); } } }
Comments
Post a Comment