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!!

Amit Patriwala

(Manager – www.ivorywebdesign.com)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s