Reputation: 1114
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:
etc.
Upvotes: 5
Views: 2316
Reputation: 269
I had the same problem and searched and tried so many things. It turned out I had to "Enable 32-bit Applications" in the application pool that my app on IIS was using. Here's how:
On the Server you deployed your OWIN Application to...
Open IIS
Go to Application Pools
Right click on the application pool your OWIN app is using and click "advanced settings" (if you don't know what application pool your OWIN app is using, right click on your app -> "manage website" -> "advanced settings" -> "Application Pool" is the first item on list)
Set "Enable 32-bit Applications" to true
Restart app and if that was the problem, you app should now work.
Upvotes: 3
Reputation: 1114
Seems to be a problem with TEMP files of ASP and IIS.
So, to fix it, I followed the next steps:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
and into:
C:\Users\[Your User]\AppData\Local\Temp\Temporary ASP.NET Files\
. I hope this help someone; I spent a lot of time with this nasty issue.
Upvotes: 3