2016年12月25日 星期日

[MVC] Server Error "owin:AutomaticAppStartup"

遇到就筆記一下…


[問題描述]

在空白MVC專案,從NuGet Package 安裝Owin套件後執行,發生錯誤訊息「To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config…」


[錯誤訊息]

'/' 應用程式中發生伺服器錯誤。


The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No assembly found containing a Startup or [AssemblyName].Startup class.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.



[解決方案]

在Web.config加入
<add key="owin:AutomaticAppStartup" value="false" /> 



Ref: 
OwinStartupAttribute required in web.config to correct Server Error

沒有留言:

張貼留言