Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SignalR causing major issues on upgrade

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
like image 826
Filling The Stack is What I DO Avatar asked Nov 06 '13 14:11

Filling The Stack is What I DO


2 Answers

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.

like image 125
Praburaj Avatar answered Oct 12 '22 22:10

Praburaj


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.

like image 33
Dragouf Avatar answered Oct 12 '22 23:10

Dragouf