OWIN Startup Class Missing

前端 未结 19 1021
攒了一身酷
攒了一身酷 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:27

    Have a look for the Startup.cs file, you might be missing one of these. This file is the entry point for OWIN, so it sounds like this is missing. Take a look at OWIN Startup class here to understand whats going on.

    As your error specifies, you can disable this in the web.config by doing the following...

    To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config

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

    Just check that your packages.config file is checked in (when excluded, there will be a red no-entry symbol shown in the explorer). For some bizarre reason mine was excluded and caused this issue.

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

    My case? I had startup file, but it is excluded in the project. I just included it and the error left.

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

    While I can't fully explain why this solved the issue for me, I ran into a problem like this after I changed my API project to build to separate \debug and \release folders. Once I reverted that change back to build to a single \bin folder things started working.

    I wrote up my experience here: Can't get the OWIN Startup class to run in IIS Express after renaming ASP.NET project file

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

    If you don't want to use the OWIN startup, this is what you should add to your web.config file:

    Under AppSettings add the following line:

        <add key="owin:AutomaticAppStartup" value="false" />
    

    This is how it should look like in your web.config:

      <appSettings>
        <add key="owin:AutomaticAppStartup" value="false" />
      </appSettings>
    
    0 讨论(0)
  • 2020-11-29 16:29

    This could be faced in Visual Studio 2015 as well when you use the Azure AD with a MVC project. Here it create the startup file as Startup.Auth.cs in App_Start folder but it will be missing the

    [assembly: OwinStartup(typeof(MyWebApp.Startup))]
    

    So add it and you should be good to go. This goes before the namespace start.

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