0

Am not able to fully do interactive debugging on self-published NuGets sitting in a folder/network share.

Best case scenario, if the source code matches the NuGet file used, then step-in debugging occurs. Otherwise, F11 merely steps over lines calling out to our assemblies. I.E. if we want to debug alpha.2 and alpha.3 is present, no step-in occurs.

Followed guidelines from here and here with no luck.

Environment is VS2017 (VS2019 appears to work OK)

Examples seem to nearly always reach out via SourceLink to NuGet.org. This is not viable for us as these are proprietary libraries, so <EmbedAllSources> I am hoping does indeed embed sources

Here are my synthetic tests to reproduce/fix the issue:

https://bitbucket.org/malachib/playground.c/src/master/src/PGC-25/

Snippet of csproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>

    <VersionPrefix>1.0.1</VersionPrefix>
    <VersionSuffix>alpha.4</VersionSuffix>
    <PackageId>Playground.PGC-25.poc2</PackageId>
    <IncludeSymbols>true</IncludeSymbols>
    <EmbedAllSources>true</EmbedAllSources>
    <DebugType>portable</DebugType>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>

  </PropertyGroup>

</Project>
Malachi
  • 2,260
  • 3
  • 27
  • 40

1 Answers1

1

Unfortunately, this currently is not supported. See issue in NuGet repository: Debugging locally with snupkgs is difficult #8809

They recommend to embed pdb files in nuget .nupkg package (see Alternative PDB distribution). This will have an impact on its size, and then on restore step of every project consuming this package.

Tradeoff is to manually download .snupkg from some place (network share or git assets), and extract .pdb file to the local nuget cache folder, besides .dll.

Eric Boumendil
  • 2,318
  • 1
  • 27
  • 32