OWIN Startup class not detected

I've seen quite a lot of people running into the issue where their OWIN startup class is not detected. Here are some of the more common reasons why the OWIN startup class is not detected.

  • Check if your IIS application pool is in Integrated mode. Note: Running of an OWIN middleware is supported only on IIS Integrated pipeline. Classic pool is not supported. 
  • Check if you have Microsoft.Owin.Host.SystemWeb Nuget package installed. This package is required for the OWIN startup class detection.
  • [Learnt from comments - Thanks @Eric]: If your Startup class is still not detected in IIS, try it again by clearing the ASP.net temporary files. 
Here is a detailed article on OWIN startup class detection for reference. 
Comments (22)

  1. Gary Davis says:

    I have this issue. I have added OWIN to an existing MVC4 website that I first upgraded to MVC5. The AppPool is V4 Integrated and I have installed the OWIN Host SystemWeb via NuGet along with several other OWIN packages to prepare to add AspNet Identity.

    I added the Startup.cs file

    [assembly: OwinStartup(typeof(Store24Next.Web.Startup))]

    namespace Store24Next.Web


       public partial class Startup


           public void Configuration(IAppBuilder app)



    I set a breakpoint in the Configuration() function but it never breaks.

    I tried adding this to the appSettings but it did not help and I assume it is the default anyway.

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

    There is an existing Global.asax and it runs the Application_Start(). Is there anything needed or restricted in the Global and/or Web.Config?



  2. Gary Davis says:

    Oh, I did verify the bin folder contains the Microsoft.Owin.Host.SystemWeb. Also, I am using the pre-release version "2.1.0-rtw-21218-737-dev".


  3. Gary Davis says:

    I changed the web property to use IIS Express instead of Local IIS and the breakpoint in the Configuration() function is now hit.

    Is there a way to use Local IIS? It seems like it should be possible according to the "class detection" document mentioned above.


  4. @Gary the startup detection should work irrespective of IIS/IISExpress. If the breakpoint is hit in IISExpress, may be the break point will be hit in IIS as well – could you check if VS is attached to w3wp.exe correctly. Alternatively you could try one thing. Throw an exception from the Configuration() method to see if you get yellow screen of death which can confirm your Configuration method is invoked. Let me know how this goes.

  5. Gary Davis says:

    I added the throw() and it traps in IIS Express but not in Local IIS.

    One thing I do that may be different than others is in my web project properties, I have Local IIS but also I have Project URL=http://NextMVC5.aec and Override application root URL unchecked but the disabled box also shows http://NextMVC5.aec. In addition, in my Hosts file, I have NextMVC5 specified. Finally, IIS manager has the website configured with a host header binding for NextMVC5.

    Maybe that configuration prevents the startup class detection for some reason.


  6. EricHerlitz says:

    I'm having the exact same issue.


    Works just fine in IIS Express but the Local IIS doesn't recognize the assembly

  7. EricHerlitz says:

    Aaaand there I gave myself the clue to the error. IIS uses Temporary ASP.NET Files to cache binaries, IIS Express don't. Empty that cache and this error is gone.

  8. Gary Davis says:

    Thanks, Eric. Clearing the Temporary ASP.Net Files solved the IIS issue for me too.


  9. Thanks @Eric, I updated the blog post with this pointer.

  10. Vladimir Kelman says:

    I've just hit the same roadblock. Clearing Temporary ASP.NET Files didn't help. 🙁

    Owin Startup is hit under IIS Express, but not under local IIS. I'm on Win 7, 64 bit machine (IIS 7.5)

  11. C. Kelly Wilson says:

    Like Vladimir, I cleared the Temporary ASP.NET Files but was still not able to debug into the Startup.Configuration class when using Local IIS.

    I performed the following and it still did not work.

    1)   Ensure I had the assembly attribute in the Startup.cs file ([assembly: OwinStartup(typeof(<your_app>.Startup))])  

    2)   Right-click on the Web Api project using OWIN –> Properties.

    3)   In the Properties window, click on the "Web" tab and under "Start Action", select the last radio button "Don't open a page. Wait for a request from an external application."

    4)   Launched Debug –> Attach to Process…" and selected "w3wp.exe" for local IIS worker process. I set the project properties to use IIS Express and I was still not able to launch the debugger into the Startup.Configuration() method.

    I set my project properties to use IIS Express and I was able to debug into the Startup.Configuration() method.

  12. S. Parsons says:

    Like C. Kelly Wilson I have run into the same issue. Only since Upgrade 3 has this started happening…

  13. Dexter says:

    I'm surprised this issue STILL isn't fixed. I just deployed my application into a manage hosting environment and they are refusing to clear the Temporary ASP.NET Files folder for us. I have already verified in our debug environment that this is the culprit, as clearing this folder made OWIN work. Why is this even happening?

  14. Kalyan says:

    I am using OWIN to host in IIS for WEB API. When a web API request sent i am expecting startup.configuration() to hit but it is not. Any thoughts, i am using web api 2.1.

    Also, Can I configure OWIN to handle only web API requests not any other requests.

    Just FYI, if  i write app.use or app.run in  configuration method then it will hit the break point.

  15. Kevin says:

    I ran into this issue as well and none of the suggestions worked for me.  But I then found if I edited the web.config and changed <compilation debug="true" targetFramework="4.5" optimizeCompilations="true"> to <compilation debug="true" targetFramework="4.5" optimizeCompilations="false">, the problem cleared up.  IIS seems to have some of the code precompiled.  After running it successfully I was able to change back to "true".

  16. Sathish says:

    @Prabhu – I have tried all the steps provided above but still not working for me. When I switch to IISExpress then Startup class is being called. But in IIS, not working. I am using Win 7, IIS 6.1. I have included the Microsoft.Owin.Host.SystemWeb package, app pool set to integrated and everything else is set fine. But still Configure method in Startup class not called. Is there any other way or am I missing any other step? Please help!!!

  17. Irene says:

    I have a problem after deployed my Web API to production server.  I’m getting 404 error but only on the authentication request.

    We had no issues in all lower environments.  I’ve run out of guesses what to try.  The server is Windows 8 sp2 with IIS 7,  Framework 4.5.1.  

          <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />

           <bindingRedirect oldVersion="" newVersion="" />

    Please help!



  18. Drew says:

    What Kevin said about changing optimizeCompilations from True to False did the trick for me. Thanks Kevin.

  19. fhrn71 says:

    Three more hints:

    – check your build output is written to bin instead of a subfolder like bindebug

    – check you have renamed your app.config to web.config

    – check your namespace equals to the assembly name.

  20. Raj says:

    After renaming my project and solution startup.cs is not getting hit by debugger when i run the project in visual studio. I tried all the ways mentioned above but it is not hitting. why ?

  21. Laksh says:

    I think this issue still persist. I am using VS 2013 Update 5. I still cant debug OWIN startup class when debug using IIS. Works when i debug using IIS Express.

    I know for sure the startup class is getting executed because if i throw explicit exception the application shows that error.

    But still cant debug it.

  22. hari_itsolution says:

    Nice article thanks Praburaj…

Skip to main content