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

浪子不回头ぞ 提交于 2020-01-25 09:25:09

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/48239792/is-it-possible-to-override-or-clear-the-debug-path-in-a-dll-build-with-new-cspro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!