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
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:
To me it looks like the package is in a state where this should be working - shouldn't it?
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.