One of possible solutions to use OWIN startup.
Install nuget package: install-package Microsoft.Owin.Host.SystemWeb
Add to appsettings startup class:
<appSettings>
<add key="owin:appStartup" value="MyProject.Code.Startup" />
</appSettings>
And by convention you will need class with method called Configuration:
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.Run(context =>
{
string t = DateTime.Now.Millisecond.ToString();
return context.Response.WriteAsync(t + " Production OWIN App");
});
}
}
Or do anything you need.
If you interesting in it, check it asp.net: OWIN and Katana project