Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Adding OWIN startup class to new empty episerver site

$
0
0

Hi,

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:

app.Run(context =>
{
context.Response.ContentType = "text/plain";
return context.Response.WriteAsync("Sam testing 123 123 123.");
});


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.

Sam


Viewing all articles
Browse latest Browse all 9076

Trending Articles