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
?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With