Debugging (How Do I in C#)
This page links to Help on widely used debugging tasks. For more information about other categories of popular tasks covered in Help, see How Do I in C#.
Using the Visual Studio Debugger
Building in Visual Studio
Discusses tools for continuously testing and debugging applications as you build them.Debugging in Visual Studio
Discusses the fundamentals of using the Visual Studio debugger.Debugger Roadmap
Links to articles on basic tasks in debugging and features of the debugger.
.NET Framework Trace Functionality
How to: Add Trace Statements to Application Code
Explains how to use the methods: Write, WriteIf, WriteLine, WriteLineIf, Assert, and Fail for tracing in your application.How to: Create and Initialize Trace Listeners
Explains how to create and initialize trace listeners.How to: Use TraceSource and Filters with Trace Listeners
Describes the use of TraceSource coupled with an application configuration file.How to: Create and Initialize Trace Switches
Explains how to create and initialize a trace switch.How to: Compile Conditionally with Trace and Debug
Explains how to specify the compiler settings for your application in several ways.How to: Create and Initialize Trace Sources
Explains how to use configuration files to facilitate the reconfiguration of the traces produced by trace sources at run time.Enhancing Debugging with the Debugger Display Attributes
Explains how to enhance debugging with the debugger display attributes.How to: Trace Code in an Application
Explains how to use the Trace class that allows you to instrument your application.How to: Configure Trace Switches
Explains how to use the .config file to configure switches.
Debugging Web Services
- Walkthrough: Debugging an XML Web Service
Provides steps for debugging Web services.
Debugging Windows Forms
- Walkthrough: Debugging a Windows Form
Describes debugging Windows forms applications.
Debugging SQL Applications
Debugging Support (LINQ to SQL)
Links to various topics on debugging LINQ to SQL applications.Walkthrough: Debug a SQL CLR User-Defined Table-Valued Function
Shows how to debug a SQL Server CLR integration User Defined Table-Valued Function (UDF).Walkthrough: Debugging a SQL CLR Trigger
Shows how to debug a SQL Server CLR integration trigger. It uses the Contact table in the AdventureWorks sample database, which is one of the databases installed with SQL Server 2005. The sample creates a new insert CLR trigger on the Contact table, and then steps into it.Walkthrough: Debugging a SQL CLR User-Defined Type
Shows how to debug a SQL Server CLR integration user-defined type. It creates a new SQL Server CLR integration type in the Adventureworks sample database. The type is then used in a table definition, an INSERT statement, and then a SELECT statement.Walkthrough: Debugging a SQL CLR User-Defined Scalar Function
Shows how to debug SQL Server CLR integration User Defined Function (UDF). It creates a new SQL Server CLR integration User-Defined Function in the Adventureworks sample database.Walkthrough: Debugging a SQL CLR User-Defined Aggregate
Shows how to debug a SQL Server CLR integration user-defined aggregate. It creates a new SQL Server CLR integration aggregate function named Concatenate in the Adventureworks sample database. When this function is invoked in a SQL statement, it will concatenate together all the values for the column specified as its input parameter.Transact-SQL Database Debugging
Describes the necessary setup procedures, and provides a sample that illustrates how to debug a multi-tiered application.Walkthrough: Debugging a Transact-SQL Trigger
Discusses an example that uses the Adventureworks database, which has a Sales.Currency table with an UPDATE trigger. The sample includes a stored procedure that updates a row in the table, thus causing the trigger to fire. Set breakpoints in the trigger, and by executing the stored procedure with different parameters, you can follow different execution paths in the trigger.Walkthrough: Debugging a Transact-SQL User-Defined Function
Discusses an example that uses an existing User Defined Function (UDF) in the Adventureworks database, named ufnGetStock that returns a count of items in stock for a given ProductID.Walkthrough: Debug a Transact-SQL Stored Procedure
Shows how to create and debug a Transact-SQL stored procedure by Direct Database Debugging, i.e. stepping into it via Server Explorer. It also illustrates different debugging techniques such as setting breakpoints, viewing data items, etc.
Additional Resources
This site requires an Internet connection.
- Visual Studio 2005 Developer Center
Contains many articles and resources on developing and debugging applications. This site is updated regularly with new content.