I have a Web API 2 application, hosted on IIS.
To configure OWIN, it has an startup class similar to this:
[assembly: OwinStartup(typeof(Startup))]
namespace Application.Api
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
throw new Exception("Owin startup class fired"); // Added for test pourposes
}
}
}
The app was working like a charm until it stops firing the Startup
class: no any change in the config file, no packages updates, the file Microsoft.Owin.Host.SystemWeb.dll is present in the bin folder, the configuration is ok, etc.
Only it stops working, but if I set the project as Startup Project and run it with F5 using IIS Express the startup class is loaded correctly.
I checked other posts with probably causes without luck:
- OWIN not firing up if project not set as Startup with IIS Express
- OwinStartup not firing
- OwinStartup not Starting ... Why?
- Can't get the OWIN Startup class to run in IIS Express after renaming ASP.NET project file
etc.