如何在PDB中嵌入C#源代码进行调试?

问题描述

这是我的csproj文件

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>
  <PropertyGroup>
    <!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
    <EmbedAllSources>true</EmbedAllSources>
    <!--<EmbedUntrackedSources>true</EmbedUntrackedSources>-->
    <!-- Optional: Build symbol package (.snupkg) to distribute the PDB containing Source Link -->
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
    <AssemblyVersion>1.0.2.0</AssemblyVersion>
    <FiLeversion>1.0.2.0</FiLeversion>
    <Version>1.0.2</Version>
  </PropertyGroup>

</Project>

在调试时,可以正确下载PDB文件,但是无法通过PDB找到源文件。调试器仍会弹出选择源文件的对话框。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)