SignalR causing major issues on upgrade

12,845

Solution 1

This is because the runtime is not able to detect a startup class in your assembly. In your project try to add an assembly level attribute specifying your startup class

[assembly: OwinStartup(typeof(YourStartupClass))]. 

Alternatively you can specify the start up class as an appSetting in your web.config like:

<appSettings>
 <add key="owin:AppStartup" value="<FullyqualifiednameofStartupclass>,<assemblyName>" />
</appSettings>

For more information on startup class detection refer this tutorials.

Solution 2

Or it's just because of a missing startup.cs file which is often create by asp.net mvc template when you create a new project with authentication.

It happen to me because I didn't choose to add authentication.

To solve this so, just add a startup.cs file at the root of your project like this :

using Microsoft.Owin;
using Owin;

[assembly: OwinStartupAttribute(typeof(MyProjectNamespace.Startup))]
namespace MyProjectNamespace
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
            //ConfigureAuth(app);
        }
    }
}

and it should work.

It's an alternative to the accepted answer.

Share:
12,845
Filling The Stack is What I DO
Author by

Filling The Stack is What I DO

I specialize in complex software solutions for the construction industry, specifically CAD drafting and automation architectural solutions. However, I do not limit myself to this one specific industry, I love coding and it is my passion thus I will take on any challenge. Erik Little Bits Builder [email protected] 469-540-8417

Updated on June 25, 2022

Comments

  • Filling The Stack is What I DO
    Filling The Stack is What I DO almost 2 years

    After two days I've been able to finally get the new SignalR installed;however, I'm faced with another issue.

    I've either removed the specific Owin Assembly or lost reference to it some how.

    I've checked my bin, packages, and reference folders and all the original Owin naming conventions are visible.

    Anyone save me from this tragedy and show me how to fix this?

    Here is the server error returned from iis.

        Server Error in '/' Application.
    
    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.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: 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.
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace: 
    
    
    [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() +357
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +28
       System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
       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) +9874840
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
    
  • Filling The Stack is What I DO
    Filling The Stack is What I DO over 10 years
    It's in my bin and I've got it referenced.
  • Filling The Stack is What I DO
    Filling The Stack is What I DO over 10 years
    Yep that is it, just found it. Man, so much trouble for such an easy task.