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

45,194

Solution 1

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>

Solution 2

It seems that Nuget didn't upgrade the SignalR dependencies properly (it must check that the version is in range and not bother updating) so 2 versions of the OWIN assemblies were being used in the solution.

So in the WebApi Project : SignalR 2.1.0 and Microsoft.Owin 2.0.2.0

and in another project : SignalR 2.1.0 and Microsoft.Owin 2.0.1.0

Visual Studio doesn't pick up the version incompatibilities on build either, so when the Web project loads up OWIN throws a nasty error (the Microsoft.Owin 2.0.1.0 assemblies were copied to the Web Project bin folder).

To fix I had to "update-package Microsoft.Owin -version 2.0.2.0" on the out-of-date project, clean and rebuild everything.

UPDATE:

Still getting the same problem. I assume now that it's some incompatibility issue between SignalR 2.1.0 and Owin 2.0.2.0.

Share:
45,194
SturmUndDrang
Author by

SturmUndDrang

Updated on July 09, 2022

Comments

  • SturmUndDrang
    SturmUndDrang almost 2 years

    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

  • AdamC
    AdamC over 7 years
    Thanks! This fixed it for me.