Article ID: 893657 - View products that this article applies to.
ASP.NET Support Voice Column
Debugging ASP.NET with the CLR DebuggerTo customize this column to your needs, we want to invite you to submit your ideas about topics that interest you and issues that you want to see addressed in future Knowledge Base articles and Support Voice columns. You can submit your ideas and feedback using the Ask For It
(http://support.microsoft.com/common/survey.aspx?scid=sw;en;1176&p0=&p1=&p2=&p3=&p4=)form. There's also a link to the form at the bottom of this column.
Welcome back! I'm Jim Cheshire, a support engineer here at Microsoft supporting ASP.NET. I've shared several tips in the past few months and this month we are going to discuss debugging ASP.NET with the CLR debugger, and as always, send us your suggestions for future columns.
So please, pull up a chair, kick off your shoes, and read through our column all about debugging ASP.NET, and remember, you can submit your ideas to us using the "ASK FOR IT" link included in every column we publish.
Debugging ASP.NET with the CLR DebuggerDuring the Troubleshooting ASP.NET series, I have done over quite a few different troubleshooting techniques using different tools. By now, you should have noticed a pattern; these techniques have all involved troubleshooting an ASP.NET application in a production environment. Why is that? Most ASP.NET developers will catch pervasive problems during the development or testing phase. The really nasty problems typically rear their head after an application has been moved to production. You can thank Murphy for that!
Last time, I showed you how to use Windbg and the SOS extension to debug a crash in the ASP.NET worker process. That’s a valuable skill to have, but let’s face it; oftentimes you just need to debug an application in a more user-friendly environment. In those cases, Visual Studio .NET is an excellent choice, assuming you are able to remotely debug or install it on the server. In cases where those are not viable options, you can still have all of the convenience and familiarity of Visual Studio .NET without the overhead by using the CLR Debugger.
The CLR Debugger is a debugger that comes with the .NET Framework SDK. You can download the SDK from the following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=enIf you’re used to debugging in Visual Studio .NET, the CLR Debugger will feel familiar to you.
Collapse this imageExpand this image
After you’ve installed the .NET Framework SDK, you can find the CLR Debugger at the following location:
C:\Program Files\Microsoft.NET\SDK\v1.1\GuiDebug\DbgClr.exeDebugging with the CLR Debugger is quite straightforward. However, in order for it to work, you will need to build your application in debug mode. You don’t need to have symbols available and you don’t need to have the Debug attribute in your web.config file set to true. You will also need to install the CLR Debugger on the Web server. You cannot remotely debug with the CLR Debugger.
Once you’ve deployed an assembly built in debug mode, you’re ready to go. Here are the steps for debugging in detail.
Collapse this imageExpand this image
The CLR Debugger offers many robust debugging features. In the image above, you can see that the CLR Debugger has stopped on a breakpoint. In this screenshot, you can see the disassembly, the locals, the source window, and the call stack. All of the other familiar debugging windows are also available.
The next time you have a need to debug an ASP.NET application and you’re not able to use Visual Studio .NET, consider trying the CLR Debugger.
I've been working with Microsoft for six years on the FrontPage, VB, and ASP.NET teams. During that time, I have written for the Office Developer Center on MSDN, and am the author of a book on FrontPage, Special Edition Using Microsoft Office FrontPage 2003. I also have a Web site where I provide free add-ins for FrontPage to enable Web developers to make the most out of Microsoft products. Here is that Web site address:
http://www.jimcosoftware.comAs always, feel free to submit ideas on topics you want addressed in future columns or in the Knowledge Base using the Ask For It
Microsoft Developer Support
Article ID: 893657 - Last Review: May 18, 2007 - Revision: 2.3