Does anybody know how ASP.NET loads code snippet (i.e. the code you write including comments) on exception and displays it to user.
It is the error screen with code snippet in yellow where the line where the occurs is highlighted in red.
Does anybody know how ASP.NET loads code snippet (i.e. the code you write including comments) on exception and displays it to user.
It is the error screen with code snippet in yellow where the line where the occurs is highlighted in red.
I don't know how they do it.
But when you take the exception and retrieve the call stack it presents the file and line number where the exception occurred. Its easy enough to load the file as text and display it.