C# Was ist eigentlich dieses OWIN und wie wird man es los?

IKäsebrot

Ensign
Registriert
Juni 2014
Beiträge
245
Hallo,

ich habe eine WebForms Anwendung erstellt die auch super lief. Ich konnte jederzeit per Rechtklick eine .aspx als Startseite festlegen und alles war super. Jetzt hat ein Kumpel eine css-stylesheet mit ein Paar javascripts erstellt. Diese habe ich in das Projekt eingepflegt. Also ich habe seine css-style einfach zur masterpage gemacht und alles andere gleich beibehalten. Das ganze hat sich dann auch ein Paar mal starten lassen.. ganz normal. Seit kurzem bekomme ich aber folgende Fehlermeldung wenn ich das Projekt lokal ausführe:

Serverfehler in der Anwendung /.

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.
Beschreibung: Unbehandelte Ausnahme beim Ausführen der aktuellen Webanforderung. Überprüfen Sie die Stapelüberwachung, um weitere Informationen über diesen Fehler anzuzeigen und festzustellen, wo der Fehler im Code verursacht wurde.

Ausnahmedetails: System.EntryPointNotFoundException: 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.

Quellfehler:


Beim Ausführen der aktuellen Webanforderung wurde einen unbehandelte Ausnahme generiert. Informationen über den Ursprung und die Position der Ausnahme können mit der Ausnahmestapelüberwachung angezeigt werden.

Stapelüberwachung:



[EntryPointNotFoundException: 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.]
Microsoft.Owin.Host.SystemWeb.OwinBuilder.GetAppStartup() +764
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +103
System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
System.Threading.LazyInitializer.EnsureInitialized(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +72
Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +104
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): 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.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9950728
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

Ich habe gelesen, dass man dieses Problem beheben kann indem man einen bestimmten Tag in die web.config einpflegt. Trotzdem würde mich mal interessieren woher sowas plötzlich kommen könnte? Wirklich das ganze ist innerhalb von 2 Minuten zerschossen worden und ich krieg net raus was die Ursache war und bekomme auch den Fehler nicht beseitigt.

ASP.NET Profis Hiiiiilfe!
Ergänzung ()

Ok jetzt habe ich dem <appsettings>-Knoten in der Webconfig folgenden Eintrag beigefügt:
<add key="owin:AutomaticAppStartup" value="false" />

Jetzt läuft alles. Trotzdem verstehe ich nicht wo dieser Fehler so plötzlich herkam? Und vor allem warum ich diesen Eintrag zuvor nicht gebraucht habe?!

Jemand eine Idee?
 
Der Webserver, welcher bei Visual Studio dabei ist ist schon so eine Sache für sich.

Um die Seite auszuführen wird Sie kompiliert und die kompilierten Elemente werden vom Server genutzt. (So weit die Theorie)
Manchmal werden Fehler erst ersichtlich, wenn man einen clean Build durchführt. Man also alle kompilierten Teile entfernt und alles komplett neu kompilieren lässt. Von Zeit zu Zeit geschieht so ein clean Build beim entwickeln automatisch. (Man hat z.B. den PC neu gestartet und es wurden die temp Verzeichnisse aufgeräumt.) Eventuell ist so dein Problem "auf einmal" augetaucht.

Ich empfehle daher bei ASP.net Projekten immer einen Clean Build durchzuführen. (Spätestens vom Commit)
 
Zurück
Oben