While reviewing some code I noticed the following code snippet;
I had no clue what Stage Markers where so time to dig in…
What are stage markers?
Stage markers play a rol when you are using OWIN in IIS. IIS has a specific execution pipeline containing a predefined set of pipeline events. If you want to run a specific set of OWIN middleware during a particular stage in the IIS pipeline, you can use the UseStageMarker
method as seen in the sample above.
Stage marker rules
There are rules on which stage of the pipeline you can execute middleware and the order components must run. Following stage events are supported:
By default, OWIN middleware runs at the last event (PreHandlerExecute
). To run a set of middleware components during an earlier stage, insert a stage marker right after the last component in the set during registration.
More information: https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-middleware-in-the-iis-integrated-pipeline