OWIN Startup Class Missing

前端 未结 19 999
攒了一身酷
攒了一身酷 2020-11-29 15:40

I\'m getting this error as my project is not able to find the reference for OWIN startup class. I\'ve even installed all the OWIN reference packages through Nug

相关标签:
19条回答
  • 2020-11-29 16:31

    I kept getting the same error when I started my project using the Browser Link Dashboard in VS2013. But, when I ran my project in debug mode, it would work. I could not figure out why and how to get the Browser Link Dashboard working. I checked the startup file, it was fine, added the appSetting line as described in some of the answers "", but nothing worked.

    Apparently, what I was doing wrong was clicking on the WRONG link in the Browser Dashboard. All the Solutions projects links show in the Browser Dashboard, but only the startup projects link works. You need to click on the link of the startup project.

    Example: I have 2 projects, both show in the Browser Dashboard, but only the one marked as the start up project will work (shows as bold in the Solution Explorer.) I thought this may help someone do the obvious, it cost me 2 days to stumble on to the obvious.

    0 讨论(0)
  • 2020-11-29 16:37

    Create One Class With Name Startup this will help you..

    public class Startup
    {
       public void Configuration(IAppBuilder app)
       {
          app.MapSignalR();
       }
    }
    
    0 讨论(0)
  • 2020-11-29 16:37

    In our project, we didn't need the OWIN functionality, so we removed all the owin references from the initial ASP.NET MVC template project. The problem occured after removing the OWIN startup class.

    The problem was the extra owin dll's in my bin folder. When I deleted them, the problem was resolved. You should delete them by deleting the bin folder. Clean Solution does not delete these dlls.

    Somehow, IIS still executes the OWIN dll's when they are in the bin folder.

    0 讨论(0)
  • 2020-11-29 16:37

    I ran into this problem after experimenting with SignalR and then removing it from the project. To resolve I had to delete the contents of the bin folder for the site on the remote server and then publish again.

    0 讨论(0)
  • 2020-11-29 16:40

    On Visual Studio 2013 RC2, there is a template for this. Just add it to App_Start folder.

    enter image description here

    The template produces such a class:

    using System;
    using System.Threading.Tasks;
    using Microsoft.Owin;
    using Owin;
    
    [assembly: OwinStartup(typeof(WebApiOsp.App_Start.Startup))]
    
    namespace WebApiOsp.App_Start
    {
        public class Startup
        {
            public void Configuration(IAppBuilder app)
            {
                // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888
            }
        }
    }
    
    0 讨论(0)
  • 2020-11-29 16:42

    Are you really trying to add OWIN to your project or is this something unexpected?

    1. In case you want to add OWIN, adding a Startup class is the way to go.

    2. In case you don't need any reference to Owin:

      delete Owin.dll from your /bin folder.

      Owin.dll is the one trying to identify the Startup class.

    0 讨论(0)
提交回复
热议问题