pathcsprojpdb-filesdumpbin

Is it possible to override or clear the debug path in a dll build with new csproj project file?


When using dumpbin to view details on my library:
dumpbin /headers Test.dll

I see that {{FullFolder to Test.pdb}} is the full folder to the pdb.

Debug Directories

    Time Type        Size      RVA  Pointer
-------- ------- -------- -------- --------
95BA9373 cv            A1 000199D4    17BD4    Format: RSDS, {4AF64893-BAF4-4FF3-9343-E8D5A55E94FF}, 1, {{FullFolder to Test.pdb}}
00000000 repro          0 00000000        0

Is there a way to exclude this in the csproj file ?

My .csproj looks like:

<DebugType>full</DebugType>
<IncludeSource>True</IncludeSource>
<IncludeSymbols>True</IncludeSymbols>
<PdbPath>none</PdbPath>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

And it seems that PdbPath element does not work anymore in a new (vs2017 multiple frameworks) .csproj format?


Solution

  • The compiler flag that was introduced in roslyn 2+ for this is /pathmap or the csproj equivalent PathMap property:

    <PropertyGroup>
      <PathMap>$(MSBuildProjectDirectory)=/some/dir</PathMap>
    </PropertyGroup>