Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate PDB's for .net managed projects in release mode?

I know PDBs are generated for managed projects in .NET by giving the compiler the /debug argument. Is there a way to specify this in the VS (2005) GUI?

The only way I could get it to generate PDBs in release mode so far is to manually modify the .csproj file and to add :

<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>

under the 'release' settings:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

Another thing: I learned from MSDN here that the possible values for the DebugType tag are:

  • full
  • pdbonly
  • none

How do these values affect the compiler's behaviour?

like image 239
Cristian Diaconescu Avatar asked Feb 25 '09 09:02

Cristian Diaconescu


2 Answers

In DEBUG:

<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>

In RELEASE:

<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
like image 120
Daniel P. Bullington Avatar answered Nov 05 '22 03:11

Daniel P. Bullington


In VS2008, you can set the property using the project properties -> Build -> Advanced... -> Debug Info.

like image 44
mmx Avatar answered Nov 05 '22 03:11

mmx