6

I am interested in knowing how IIS invokes the OWIN pipeline during the application lifecycle.

  1. I tried to know this and found that the assembly Microsoft.Owin.Host.SystemWeb is responsible for this, but a diagram explaining this will be very helpful for myself and others that are willing to learn about OWIN.

  2. With respect to OWINHost, I was able to figure out how OwinHost sets up the host and then invokes the other OMC etc.

  3. Additionally, I am interested in finding out how the HttpModules that we built in can be used with OWINHost and IIS hosting.

Having filtered through the web, I stand left puzzling and quizzing about these stuff. Suitable pointers or documents will be of great help.

Links referred :

Owin Spec Owin Request pipeline explanation ASP.Net Architecture

pholpar
  • 1,725
  • 2
  • 14
  • 23
Saravanan
  • 7,637
  • 5
  • 41
  • 72
  • 1
    Here is an article that explains how OWIN middleware runs on integrated pipeline: http://www.asp.net/aspnet/overview/owin-and-katana/owin-middleware-in-the-iis-integrated-pipeline – Praburaj Mar 19 '14 at 13:51
  • Can you let me know how the owinhttphandler is registered within the Microsoft.Owin.Host.Systemweb dll. I find that the OwinHttpModule is being registered before the application_start. – Saravanan Mar 19 '14 at 17:48
  • It happens in the PreApplicationStart : http://msdn.microsoft.com/en-us/library/system.web.preapplicationstartmethodattribute(v=vs.110).aspx – Praburaj Mar 20 '14 at 17:17
  • Thank you, I already found the OwinHttpModule Registration, I was wondering how will the OwinHttpHandler be registered in the IIS pipeline. Also, any pre-registered HttpModules in web.config is run prior to OwinMiddleware, is this the right behavior – Saravanan Mar 21 '14 at 16:00
  • In case if you are still looking, `OwinRoute.GetRouteData` (http://katanaproject.codeplex.com/SourceControl/latest#src/Microsoft.Owin.Host.SystemWeb/OwinRoute.cs) uses `OwinRouteHandler` which uses `OwinHttpHandler`. So when I think uisng routes through `RouteCollectionExtensions.MapOwinRoute` extensions will result in invoking the handler. – Sri Harsha Velicheti May 13 '14 at 22:28

1 Answers1

6

The Microsoft.Owin.Host.SystemWebuses the PreApplicationStartMethodAttribute to bootstrap itself. The code for it can be seen here. You can read more about the usage of the PreApplicationStartMethodAttribute here.

user643011
  • 2,163
  • 3
  • 21
  • 38
Brian Surowiec
  • 17,123
  • 8
  • 41
  • 64