Microsoft KB Archive/308626

= Roadmap for debugging in the .NET Framework and Visual Studio .NET =

Article ID: 308626

Article Last Modified on 5/21/2007

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft .NET Framework 1.0

-



This article was previously published under Q308626



SUMMARY
This article provides a roadmap to learn and to master how to debug applications that use the .NET Framework. To help you learn about a Microsoft product or technology, roadmap articles provide links to useful information, including online documentation, Microsoft Knowledge Base articles, and white papers.

This article contains the following sections:
 * Overview
 * Architecture
 * Key debugging concepts and QuickStart tutorials
 * HowTo articles
 * Walkthroughs and WebCasts
 * Troubleshooting
 * REFERENCES

Overview
To debug an application efficiently, it is very important that you have a basic understanding of the .NET technology. This article assumes that you are familiar with the following .NET Framework concepts:
 * Managed code
 * Garbage collection
 * Assemblies
 * Security

For more information, refer to the following topics in the Visual Studio .NET Help documentation:

Introduction to Developing with the .NET Framework

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cptutorials/html/introduction_to_developing_with_the__net_framework.asp

Common Language Runtime

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpguide/html/cpconthecommonlanguageruntime.asp

Programming for Garbage Collection

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpguide/html/cpconprogrammingessentialsforgarbagecollection.asp

Assemblies

http://msdn2.microsoft.com/en-us/library/hk5f40ct(vs.71).aspx

Securing Applications

http://msdn2.microsoft.com/en-us/library/fkytk30f(vs.71).aspx

back to the top

Architecture
The links that follow provide architectural information about the debugger tools and about other troubleshooting tools.

You can debug a Microsoft .NET Framework application by using one of the three debuggers:  The Microsoft Visual Studio .NET debugger, which is integrated with the Visual Studio .NET integrated development environment (IDE), is the most sophisticated debugger that you can use. The Visual Studio .NET debugger incorporates most of the features from the debuggers that are included with Microsoft Visual Basic 6.0 and Microsoft Visual C++ 6.0.

In addition, the Visual Studio .NET debugger adds some very important features, such as better facilities for remote debugging, cross-language debugging, remote attach, detaching without killing the application, and so on. When you use this debugger, you can debug both managed code and unmanaged code, even when the code is mixed. For more information about the Visual Studio .NET debugger, click the following link:

Debugging

http://msdn2.microsoft.com/en-us/library/sc65sadd(vs.71).aspx

 The CorDbg.exe file is a command-line, stand-alone, run-time debugger that works only on managed code. You can debug any application that is written in a language that the common language runtime supports, (for example, Microsoft Visual Basic, Microsoft Visual C#, and so on). However, you cannot perform remote debugging. This debugger requires the least amount of memory of the three debuggers in this article. For more information about CorDbg.exe, refer to the following topic in the Visual Studio .NET Help documentation:

Appendix B: Runtime Debugger (CorDbg.exe)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cptutorials/html/appendix_b__runtime_debugger_cordbg.asp

 The Microsoft CLR Debugger (DbgCLR.exe) is also a stand-alone debugger. However, DbgCLR.exe has a Windows user interface. For more information about DbgCLR.exe, refer to the following topic in the Visual Studio .NET Help documentation:

CLR debugger

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ netstart/html/vcoriTheCOM20SDKDebugger.asp



In addition to using the debugger tools, you may need to adjust some settings in your application to help you troubleshoot or to help maximize performance of the system. For more information about the System.Diagnostics namespace and the main classes in this namespace (Debug and Trace), as well as about performance monitoring classes, refer to the following topic in the Visual Studio .NET Help documentation:

System.Diagnostics Namespace

http://msdn2.microsoft.com/en-us/library/system.diagnostics(vs.71).aspx

When you want to optimize the application's performance, you need some additional tools. For more information about these tools that can help you profile and monitor performance, refer to the following topic in the Visual Studio .NET Help documentation:

Debugging and Profiling Applications

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cpguide/html/cpcondebuggingprofiling.asp

In addition to the debuggers and tracing facilities, the .NET Framework includes several tools that can help you troubleshoot your application. For a list of these tools, refer to the following Visual Studio .NET Help documentation:

.NET Framework Tools

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconnetframeworktools.asp

back to the top

Key debugging concepts and QuickStart tutorials
For information about key debugging concepts, refer to the following Microsoft QuickStart tutorials:

Introduction to Debugging

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ cptutorials/html/introduction_to_debugging.asp

Debugging .NET Framework Applications

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/ html/debugging__net_framework_applications.asp?frame=true

Debugging with the Microsoft .NET Framework SDK

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/ html/debugging_with_the__net_framework.asp

The Troubleshooting Problems portal can help you to find the information that you need to troubleshoot a problem. For more information about the portal, and for links to several topics that are related to debugging and diagnostics, visit the following MSDN Web site:

Troubleshooting Problems Portal

http://msdn2.microsoft.com/en-us/library/04d02ak5(vs.71).aspx

Although you may be familiar with earlier versions of the debugger, visit the following MSDN Web sites for more information about the new features in the Visual Basic .NET debugger:

What's New in Debugging

http://msdn2.microsoft.com/en-us/library/aa984470(VS.71).aspx

Debugging

http://msdn2.microsoft.com/en-us/library/sc65sadd(vs.71).aspx

Regardless of the type of application that you are developing (for example, a Web service, a Windows service, or a Microsoft ASP.NET application), you can find specific topics about how to debug in the Help documentation. For more information about these specialized topics, refer to the following Visual Studio .NET Help documentation:

Introduction to Web Application Debugging

http://msdn2.microsoft.com/en-us/library/cx6214f0(vs.71).aspx

Debugging XML Web Services in Managed Code

http://msdn2.microsoft.com/en-us/library/s9w03xfd(vs.71).aspx

Debugging Windows Service Applications

http://msdn2.microsoft.com/en-us/library/aa984342(VS.71).aspx

Debugging COM and ActiveX

http://msdn2.microsoft.com/en-us/library/f1tkezh9(vs.71).aspx

Debugging DLLs

http://msdn2.microsoft.com/en-us/library/c91k1xcf(vs.71).aspx

Debugging Script and Web Applications

http://msdn2.microsoft.com/en-us/library/zxfz3z3h(vs.71).aspx

Debugging SQL

http://msdn2.microsoft.com/en-us/library/zefbf0t6(vs.71).aspx

Debugging User Interface Reference

http://msdn2.microsoft.com/en-us/library/cwzf7x3e(vs.71).aspx

Debugging with IIS 4.0 or Later

http://msdn2.microsoft.com/en-us/library/aa291262(VS.71).aspx

back to the top

HowTo Articles
HowTo articles provide step-by-step instructions about how to accomplish specific tasks. For a list of How To articles about Visual Studio .NET, search the Microsoft Knowledge Base by running the following query, and then narrow your search by providing additional search criteria:

HowTo Article Search

Click here to view a list of Visual Studio .NET HowTo articles

back to the top

Walkthroughs and WebCasts
Walkthroughs provide mini-tutorials that walk you through the debugging process of some types of applications. For more information about debugging samples, refer to the following Visual Studio .NET Help documentation:

Debugging .NET Framework Applications

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/ html/debugging__net_framework_applications.asp?frame=true

Debugging ASP.NET Web Applications

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptutorials/html/debugging_with_the__net_framework.asp

Support WebCasts

http://support.microsoft.com/ default.aspx?scid=FH;EN-US;webcst&&FR=0&&SD=GN&&LN=EN-US&&

back to the top

Troubleshooting
If you encounter problems and need answers to your questions, consult the MSDN newsgroups. The MSDN newsgroups are the best place to obtain answers to your questions. In the MSDN newsgroups, you can share your experiences with your peers or search the Microsoft Knowledge Base for articles about specific issues:

MSDN Newsgroups

http://msdn.microsoft.com/newsgroups/

Microsoft Knowledge Base

http://support.microsoft.com/search

back to the top

