Edit

Share via


Project settings for C# debug configurations

You can change C# project debug settings in the Debug tab and Build tab of the project property pages.

To open the property pages, select the project in Solution Explorer and then select the Properties icon, or right-click the project and select Properties.

For more information, see Debug and release configurations.

Important

These settings don't apply to .NET Core, ASP.NET, or UWP apps. To configure debug settings for .NET 5+ and .NET Core, see Project settings for C# debug configurations (.NET 5+, .NET Core).

Important

These settings don't apply to .NET Core, ASP.NET, or UWP apps. To configure debug settings for UWP apps, see Start a debugging session for a UWP app.

Debug tab

Setting Description
Configuration Sets mode for building the app. Select Active (Debug), Debug, Release, or All Configurations from the dropdown.
Start action Specifies the action when you select Start in a Debug configuration.
- Start project is the default, and launches the startup project for debugging. For more information, see Choose the startup project.
- Start external program starts and attaches to an app that is not part of a Visual Studio project. For more information, see Attach to running processes with the debugger.
- Start browser with URL lets you debug a web app.
Start options > Command-line arguments Specifies command-line arguments for the app being debugged. The command name is the app name specified in Start external program.
Start options > Working directory Specifies the working directory of the app being debugged. In C#, the working directory is \bin\debug by default.
Start options > Use remote machine For remote debugging, select this option and enter the name of the remote debugging target, or an Msvsmon server name.
The location of an app on the remote machine is specified by the Output Path property on the Build tab. The location must be a shareable directory on the remote machine.
Debugger engine > Enable unmanaged code debugging Debugs calls to native (unmanaged) Win32 code from the managed app.
Debugger engine > Enable SQL Server debugging Debugs SQL Server database objects.

Build tab

Setting Description
General > Conditional compilation symbols Define the DEBUG and TRACE constants if selected.

These constants enable conditional compilation of the Debug class and Trace class. With these constants defined, Debug and Trace class methods generate output to the Output window. Without these constants, Debug and Trace class methods are not compiled, and no output is generated.

Usually, DEBUG is defined in the Debug version of a build and undefined in the Release version. TRACE is defined in both the Debug and Release versions.
General > Optimize code Unless a bug appears only in optimized code, leave this setting deselected for Debug builds. Optimized code is harder to debug, because instructions do not correspond directly to statements in the source code.
Output > Output path Typically set to bin\Debug for debugging.
Advanced button For information on advanced debugging options, see Advanced build settings dialog box (C#). The portable format for symbol (.pdb) files is a recent cross-platform format for .NET Core apps.

See also