How To Debug Inside The Code Of Your 3rd Party Libraries
Let’s say you are using a 3rd Party Library like ELMAH in your web site project to handle unhandled exceptions and it’s throwing an exception and you don’t know why. Since the code is open source, you would LOVE to see what line its crashing on and then submit your changes to the project so that others can benefit from the fix you made. It gives you that good feeling, right?
Well, unfortunately, you put the compiled DLL in the bin folder and when it crashes, it just crashes and burns.
How can you see the source code? Simple! Compile the source code on your machine, and copy the PDB ("Debugging Database") file to your bin folder along with the DLL, and then your web site crashes while in debug mode, it will go to the exact folder on your file system where the DLL was compiled from and show you the exact line of the error.
This was my recent experience with Elmah that it was crashing due to the fact that XMLWriter was misbehaving and throwing an exception when it was supposed to actually replace invalid entities in the XML automatically (at least, according to the MSDN documentation).
Take a look at Issue 43 on Elmah Site for more details.
Related Reading:
Other Interesting Posts
-
Articles
- January 2011
- April 2010
- March 2010
- February 2010
- January 2010
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
-
Meta







