I have solved this issue a couple of times, but because I rarely come across it, I don't recall exactly how I solved it last time.
But I would first check these things:
Microsoft.Owin.Host.SystemWeb.dllfile copied to the bin folder on build?
The configuration entries (
owin:appStartup) is not needed, when you use the attribute,
I would try copying the startup file from alloy and strip it from unneccessary things and then add all nuget packages that alloy uses.
After that works, I would strip it and remove all nuget packages I don't need. Might be a typo in an attribute somewhere. Might be a nuget package that wasn't installed correctly...
I tried the suggestions posted but nothing solved my problem. After a lot of tinkering i found the source of the issue. My Web.Config had the follwoing elelment in it:
<compilation debug="true" targetFramework="4.6.2" optimizeCompilations="true" />
when i changed optimizeCompilations to false the startup class was suddenly working. I'm not completely sure what this setting does but if anyone else is having the same problem i'd recommend checking the compilation element of the web.config.
I am trying to add a standard OWIN startup class to my episerver website but the code is not being hit when i run the site. I have cretaed a startup class (startup.cs) in the root of the application and added the attribute '[assembly: OwinStartup(typeof(Site.Web.Startup))]', i have installed the nuget package 'Microsoft.Owin.Host.SystemWeb', i have tried both with and without the web.config appsettings '<add key="owin:AutomaticAppStartup" value="true" />' and '<add key="owin:appStartup" value="Site.Web.Startup" />' but when i run the application, and go to the homepage for instance, i am not seeing the code in the startup.cs being run. At the moment the code in the startup is just this, for testing purposes:
I have checked the application pool in iis and it is definitely using .net v4 and in integrated mode.
I have created a new alloy site on the same machine and set it to run in iis and the startup class is definitely being triggered, so i think it must be something to do with the setup of the episerver site when you selet 'empty site'.
Can anyone think of anything else i can do to make this episerver website trigger the startup class? I'm out of ideas but i know it must be possible.