Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SignalR no longer working "No assembly found containing an OwinStartupAttribute"

I have a Web API project that uses SignalR which started giving me "unable to find Microsoft.AspNet.Signal.Core" errors frequently which were only fixed by doing a full rebuild in Visual Studio.

I upgraded SignalR and OWIN in Nuget to try and fix this issue, but now I always get "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"

I am the only person on my team to get this error - the same code works fine on other machines.

I have a Startup Class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Owin;
using Owin;

[assembly: OwinStartup(typeof(MyProject.Startup))]
namespace MyProject
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }
}

I have tried adding the AppStartup key to the web.config too:

<add key="owin:appStartup" value="MyProject.Startup, MyProject" />

I have the following references in my WebApi project:

Microsoft.AspNet.SignalR.Core (2.1.0.0)
Microsoft.AspNet.SignalR.SystemWeb (2.1.0.0)
Microsoft.Owin (2.0.2.0)
Microsoft.Owin.Host.SystemWeb (2.0.2.0)
Microsoft.Owin.Security (2.0.2.0)
Owin (1.0.0)

I'm using IIS 8.5 on Windows 8 64Bit

like image 730
SturmUndDrang Avatar asked Jul 16 '14 08:07

SturmUndDrang


People also ask

How do I specify OWIN startup Assembly?

Create an ASP.NET Web App using OWIN Startup Add an OWIN startup class. In Visual Studio 2017 right-click the project and select Add Class. - In the Add New Item dialog box, enter OWIN in the search field, and change the name to Startup. cs, and then select Add.

How do I disable OWIN startup discovery in web config?

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.

What is OWIN startup class?

In an OWIN application there is a Startup class that determines the components for the pipeline of the application. I am defining the OWIN startup class. In that context, you can connect with your OWIN startup class at runtime by various ways. It depends on your hosting model like IIS, OwinHost, IIS-Express.


1 Answers

I had this error during Identity Framework 2.0 integration. Adding Following in Web.config file of the project solved it:

<appSettings>
  <add key="owin:AutomaticAppStartup" value="false" />
</appSettings>
like image 76
N_E Avatar answered Oct 02 '22 05:10

N_E