In MVC5, which is integrated with OWIN (Katana) via Microsoft.Owin.Host.SystemWeb.dll, why did the MVC handler fail to execute after IAppBuilder.Run , and was executed after the IAppBuilder.Use method called?
Here are my implementations:
Case 1:
public partial class Startup { public void Configuration(IAppBuilder app) { app.Use( async (context, next) => { await context.Response.WriteAsync(@"<h1>Before MVC</h1>"); await next.Invoke();
Case 2:
public partial class Startup { public void Configuration(IAppBuilder app) { app.Run( async context => { await context.Response.WriteAsync(@"<h1>MVC has not been invoked.</h1>"); }); } }
In this case, as I know, the OWIN component runs as an HttpModule (OwinHttpModule), which is registered in the Asp.NET pipeline. So, why did the IAppBuilder.Run method skip the MVC module?
source share