Skip to content

Latest commit

 

History

History
72 lines (44 loc) · 2.71 KB

assemblydebug-add-debuggableattribute.md

File metadata and controls

72 lines (44 loc) · 2.71 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: /ASSEMBLYDEBUG (Add DebuggableAttribute)
/ASSEMBLYDEBUG (Add DebuggableAttribute)
05/11/2022
VC.Project.VCLinkerTool.AssemblyDebug
/ASSEMBLYDEBUG
/ASSEMBLYDEBUG linker option
-ASSEMBLYDEBUG linker option
ASSEMBLYDEBUG linker option
94443af3-470c-41d7-83a0-7434563d7982

/ASSEMBLYDEBUG (Add DebuggableAttribute)

Specify whether to emit the DebuggableAttribute attribute with debug information tracking and to disable JIT optimizations.

Syntax

/ASSEMBLYDEBUG[:DISABLE]

Remarks

The /ASSEMBLYDEBUG linker option emits the DebuggableAttribute attribute with debug information tracking and disables JIT optimizations. This option is the same as specifying the following attribute in source:

[assembly:Debuggable(true, true)];   // same as /ASSEMBLYDEBUG

/ASSEMBLYDEBUG:DISABLE emits the DebuggableAttribute attribute but disables the tracking of debug information and enables JIT optimizations. This option is the same as specifying the following attribute in source:

[assembly:Debuggable(false, false)];   // same as /ASSEMBLYDEBUG:DISABLE

By default, the linker doesn't emit the DebuggableAttribute attribute.

DebuggableAttribute can also be added to an assembly directly in source code. For example:

[assembly:Debuggable(true, true)];   // same as /ASSEMBLYDEBUG

You must explicitly specify that a managed image is debuggable. The /Zi option alone is insufficient.

Other linker options that affect assembly generation are:

To set this linker option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > Linker > Debug property page.

  3. Modify the Debuggable Assembly property.

To set this linker option programmatically

  • See xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AssemblyDebug%2A.

See also

MSVC linker reference
MSVC linker options