views:

11

answers:

1

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.

A: 

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.

rdkleine
I know that this is not a problem, but what if I'd like to create similar function in Win app? And if you take complied web apps that "reside" in dlls...
Karel Frajtak