0

I've read this: How to debug into my nuget package deployed from TeamCity? but for some reason my project cannot be debugged, without asking me to specify for the location of the source file. Using the following commands i was able to properly create a package (without having to add any of it in the .csproj) with symbols

The package in question is located on a local nuget feed.

It will prompt me for the source file during debugging, despite the nupkg containing debugging symbols+sources it isn't working

Commands used to produce the package:

dotnet clean "../$path"
dotnet pack "../$path" -o "$outputRoot" -v $verbosity -c $configuration -symbols --include-symbols --include-source /p:PackageVersion=$version  
Invoke-Expression "& $nugetPath push $outputRoot\$path.$version.symbols.nupkg -source $localFeed" 

Structure in local repo:

contents of local nuget feed

Nuget Repo

contents of package.id/$version/

Nuget Repo

contents of lib/net462

Nuget Repo

To me it looks like the package is in a state where this should be working - shouldn't it?

Community
  • 1
  • 1
Dbl
  • 4,675
  • 2
  • 29
  • 54

1 Answers1

0

It will prompt me for the source file during debugging, despite the nupkg containing debugging symbols+sources it isn't working

Even if the debugging symbols+sources are included in the symbols nuget package, but NuGet itself does not have the ability to parse the symbols nuget package when you debugging this nuget package in the Visual Studio. So Visual Studio still can not find the the source file during debugging. That is the reason why NuGet team publish the symbols package to the SymbolSource server.

See How to debug code in a nuget package created by me for some more details.

Besides, since Currently the NuGet package debugging and symbols experience is not streamlined., it not very easy to debug the nuget package from Visual Studio successfully. Not sure why you do not want to specify for the location of the source file, if you are interested in it, you could use the lightweight solution to debug the nuget package:

Is it possible to host both regular and symbols packages in a NuGet local feed on a network share?

I have been using this method all the time without any other issue, hope this helps you.

Leo Liu-MSFT
  • 52,692
  • 7
  • 69
  • 81
  • Such a shame. This makes source debugging only useful for public nuget packages without additional effort. Guess i'll go with the link you provided last in your answers. a local symbol server seems to be the only solution for this to work. – Dbl Aug 06 '18 at 11:46