No assembly found containing an OwinStartupAttribute

After successfully compiled the web application, we are getting below error message:

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.

Solution:

  1. To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of “false” in your web.config.Go to Web.config, now go to  <appSettings> and add below code<add key=”owin:AutomaticAppStartup” value=”false” />
  2. Add owin reference

<dependentAssembly>
<assemblyIdentity name=”Microsoft.Owin” culture=”neutral” publicKeyToken=”31bf3856ad364e35″ />
<bindingRedirect oldVersion=”0.0.0.0-3.0.1.0″ newVersion=”3.0.1.0″ />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name=”Microsoft.Owin.Security.OAuth” culture=”neutral” publicKeyToken=”31bf3856ad364e35″ />
<bindingRedirect oldVersion=”0.0.0.0-3.0.1.0″ newVersion=”3.0.1.0″ />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name=”Microsoft.Owin.Security.Cookies” culture=”neutral” publicKeyToken=”31bf3856ad364e35″ />
<bindingRedirect oldVersion=”0.0.0.0-3.0.1.0″ newVersion=”3.0.1.0″ />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name=”Microsoft.Owin.Security” culture=”neutral” publicKeyToken=”31bf3856ad364e35″ />
<bindingRedirect oldVersion=”0.0.0.0-3.0.1.0″ newVersion=”3.0.1.0″ />
</dependentAssembly>

Enjoy Programming!!

Leave a Reply

Discover more from The Engineering Behind Enterprise AI

Subscribe now to keep reading and get access to the full archive.

Continue reading