Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace WebActivator PreApplicationStartMethod with OwinStartupAttribute?

I'm using WebActivator.PreApplicationStartMethod in my current project but it seems like the OwinStartupAttribute could do the same job? Is this the proper use of the OwinStartupAttribute?

like image 808
marcus Avatar asked Jun 24 '14 07:06

marcus


1 Answers

PreApplicationStartMethodAttribute allows you to run some code early in the ASP.NET pipeline. ASP.NET requests are handled by the IIS pipeline.

Owin middleware is designed to run in a server-agnostic pipeline.
You could host owin middleware in a non-IIS environment, basically.

If you want to run Owin through the IIS pipeline you have to install and use Owin.Host.SystemWeb:

Install-Package Microsoft.Owin.Host.SystemWeb

and it seems that SystemWeb uses PreApplicationStartMethod to hook into the application startup.

So, I guess, there not much difference at the moment.

I would stick to Owin Startup considering things might change in the future.

I have found a great explanation here and these articles are worth reading.

like image 89
LeftyX Avatar answered Sep 20 '22 14:09

LeftyX