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

1

3

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?

Theodicy answered 13/1, 2018 at 12:16 Comment(1)
#65936284Uppercut
M
11

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>
Mystery answered 15/1, 2018 at 20:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.