Thursday, 14 March 2013

Catching an Exception in RazorSharp

Here is a cshtml RazorSharp page that shows how to catch an exception (note the multiple mixes of code and HTML)

image

Here is what it looks like when rendered (note the 1 line stack trace):

image

After resetting the Razor Pages compilation cache, here is another screenshot of the execution (note the different value in the StackTrace):

image