0

I have build some NuGet packages for my own libraries (a couple classic .nupkg containing just the library dll and one containing the pdb-file - the .snupkg extension) I have copied the NuGet packages into the directory of the local private NuGet repository.

Now, I have a code referencing the libraries through the NuGet packages from that local NuGet rep. I supposed I can step into the library code, but it does not work - is it somehow possible out of box /using 3rd party free tools?

Actually for a time it looked it worked, but that was probably made, that I had the symbols in my symbol cache before. :)

I noticed from SourceLink page, that it solves stepping into the code through known online providers (GitHub, BitBucket, ...) - does it by chance support also a kind of "offline" storage of the NuGet packages?

rychlmoj
  • 385
  • 1
  • 3
  • 14
  • Yes, you can use a local repo of nuget packages that contain the pdb files. Are the pdb files getting loaded? You can check in Visual Studio. – Cameron Taggart Feb 27 '19 at 15:24
  • It is good to hear it is possible - unfortunatelly I don't know much about SourceLink, I have added - PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-*" PrivateAssets="All" , but I have got a warnings: .nuget\~microsoft.sourcelink.github\1.0.0-beta2-18618-05\build\~\SourceLink.GitHub.targets(40,5): warningL Unable to determine repository url, the source code won't be available via source link . - to the question : No, I couldn't see the loaded symbols in the Debug Modules window for dll's coming from the Local NuGet packages – rychlmoj Feb 27 '19 at 17:18
  • 1
    For the nuget packages you are building, you can put the pdb files in them with https://github.com/dotnet/sourcelink#alternative-pdb-distribution – Cameron Taggart Feb 28 '19 at 22:00
  • finally it helped me to add PackageReference to the SourceLink.Embed.AllSourceFiles instead of the perhaps older and GitHub provider oriented "Microsoft.SourceLink.GitHub". – rychlmoj Mar 04 '19 at 07:54
  • the .NET 3.5 issues described [here](https://github.com/dotnet/sourcelink/issues/250) – rychlmoj Mar 04 '19 at 09:03
  • 1
    You don't need SourceLink.Embed.AllSourceFiles. It has been replaced by built-in .NET SDK functionality. See https://github.com/ctaggart/SourceLink/releases/tag/3.0.0 – Cameron Taggart Mar 05 '19 at 14:04
  • Thanks for the info with the link. However, when I tried to comment out the "SourceLink.Embed.AllSourceFiles" from my Directory.Builds.Props, the "dotnet pack" produced quite much different results (package without pdb). Further, it looked promising (pretty same as before that commenting out) in the nuget package explorer with setting up some properties , but the "sourcelink test" failed and of course also the debugging-step-in in another environment failed. I am afraid I can't get in :( – rychlmoj Mar 06 '19 at 21:13
  • 1
    To package the pdb files you need https://github.com/dotnet/sourcelink#alternative-pdb-distribution. If you wish to embed all the sources in those pdb files, you should use https://github.com/dotnet/sourcelink/tree/master/docs#embedallsources – Cameron Taggart Mar 07 '19 at 22:13
  • Thanks a lot Cameron, all that was helpful for me. I have quite limited time, hopefully I understand it much better now. – rychlmoj Mar 15 '19 at 20:36

0 Answers0