Search code examples
.netasp.netyellow-screen-of-death

How does the ASP.NET "Yellow Screen of Death" display code?


I thought .Net code gets compiled into MSIL, so I always wondered how do Yellow Screens produce the faulty code. If it's executing the compiled code, how is the compiler able to produce code from the source files in the error message?

Feel free to edit this question/title, I know it doesn't really make sense.


Solution

  • A .Net assembly is compiled with metadata about the bytecode included that allows easy decompilation of the code - that's how tools like .Net Reflector work. The PDB files are debug symbols only - the difference in the Yellow Screen Of Death is that you'll get line numbers in the stack trace.

    In other words, you'd get the code, even if the PDB files were missing.