dotnet / sourcelink

Source Link enables a great source debugging experience for your users, by adding source control metadata to your built assets
MIT License
1.26k stars 122 forks source link

use EmbedAllSources without source control? #669

Open d18zj opened 4 years ago

d18zj commented 4 years ago

This is my project file :

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</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.3.0</AssemblyVersion>
    <FileVersion>1.0.3.0</FileVersion>
    <!--<DeterministicSourcePaths>true</DeterministicSourcePaths>-->
    <Version>1.0.3</Version>
    <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
    <DebugType>portable</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>

</Project>

The debugger can be downloaded a PDB file from a private Nuget server(baget server), but a dialog box pops up to find the source file.

d18zj commented 4 years ago

Does the debugger(vs2019 16.7.6) support finding source files in the PDB?

tmat commented 3 years ago

Yes, the debugger should support it. You can inspect the PDB with pdb2xml tool. Copy the DLL and the PDB into a directory and call pdb2xml my.dll /sources. You should see entries for all source files in the generated .xml file.