Debugging OWIN app or framework

Debugging OWIN app or framework

Rate This
  • Comments 0

Diagnostics

The Microsoft.Owin.Diagnostics nuget package contains a welcome page and an error page. The UseWelcomePage extensions can be used to add a simple html page to your application to verify the site is up and running. The UseErrorPage extensions can be used to add an Exception filter to the request pipeline that will display exception and request details.This error page is similar to Yellow Screen Of Death (YSOD) in SystemWeb.

Configuring a Welcome page:

[assembly: OwinStartup(typeof(WebApplication.Startup))]
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseWelcomePage("/welcomePage");
}
}

Configuring an error page:

[assembly: OwinStartup(typeof(WebApplication.Startup))]

public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseErrorPage(new ErrorPageOptions()
{
            //Shows the OWIN environment dictionary keys and values. This detail is enabled by default if you are running your app from VS unless disabled in code. 
ShowEnvironment = true,
            //Hides cookie details
ShowCookies = false, 
            //Shows the lines of code throwing this exception. This detail is enabled by default if you are running your app from VS unless disabled in code. 
 ShowSourceCode = true,
            });

app.Run(async context =>
{
throw new Exception("UseErrorPage() demo");
await context.Response.WriteAsync("Error page demo");
});
}
}
 
Debug Symbols:
Starting with v2.0.0 Katana's debug symbols are now being published to symbolsource.org. Refer to this page to setup symbols for Katana packages. Symbols for the nightly Dev and nightly Release packages are also published to symbolsource.org. Refer katana codeplex to know the nightly feed URLs.

For more information refer to the katana codeplex here.
Leave a Comment
  • Please add 8 and 3 and type the answer here:
  • Post