[研究][ASP.NET] No assembly found containing an OwinStartupAttribute
2021-07-06
'/' 應用程式中發生伺服器錯誤。
The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No 'Configuration' method was found in class 'WebApplication1Admin.Startup, WebApplication1Admin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
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 要求的過程中發生未處理的例外狀況。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。
例外狀況詳細資訊: System.EntryPointNotFoundException: The following errors occurred while attempting to load the app.
- No assembly found containing an OwinStartupAttribute.
- No 'Configuration' method was found in class 'WebApplication1Admin.Startup, WebApplication1Admin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
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 要求期間,產生未處理的例外狀況。如需有關例外狀況來源與位置的資訊,可以使用下列的例外狀況堆疊追蹤取得。 |
堆疊追蹤:
|
版本資訊: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.8.4330.0
********************************************************************************
解決
Web.Config 加上
<appSettings > <add key="owin:AppStartup" value="false"></add> </appSettings> |
或網站根目錄放一個 Startup.cs
using Microsoft.Owin; using Owin; [assembly: OwinStartupAttribute(typeof(WebRole1.Startup))] namespace WebApplication1Admin |
(完)
沒有留言:
張貼留言