This project has moved. For the latest updates, please go here.

Owin startup and Azure WebRole question

Apr 23, 2014 at 11:37 AM
Edited Apr 23, 2014 at 12:08 PM
Hi,

I use owin to host WebApi in a WebRole (IIS).
Actually Owin is started by a magical Attribute marked in the assembly, something as:
[assembly: OwinStartup(typeof(MyWebRole.Startup))]

This startup class is doing my Autofac config and webApi config.

But I am also using a WebRole.cs class called by Azure to make some initializations and to trap Environment changes.
I would appreciate to be able to initialize the WebAPI Trace level from the webRole.cs OnStart method as I am doing for all the other tracing engines I am using.

But to do this I need to have Web API configured and so to have Owin started.

Is it possible to override the Owin startup Attribute with a direct start from the webrole.cs as I do when Owin is Self hosted in an Azure Worker role ?
Coordinator
Apr 23, 2014 at 11:06 PM
You might be able to do this using the handler instead of the module. See http://msdn.microsoft.com/en-us/library/system.web.routing.routecollectionextensions_methods(v=vs.111).aspx. You'll want to disable the module auto-startup.