Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging locally with snupkgs is difficult #8809

Open
chilakamarthi opened this issue Nov 12, 2019 · 12 comments
Open

Debugging locally with snupkgs is difficult #8809

chilakamarthi opened this issue Nov 12, 2019 · 12 comments
Labels
Area:Symbols Partner:VS-Other Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Feature

Comments

@chilakamarthi
Copy link

Hi,
I am using:
Visual Studio 2017 Version: 15.9.17
Nuget Version: 5.3.1

My UWP App project file got following settings in "Debug|AnyCPU" and "Debug|[Specific Platform]"

<DebugSymbols>true</DebugSymbols>
<EmbedAllSources>true</EmbedAllSources>
<DebugType>portable</DebugType>

I am using nuspec file to customize my requirement:

<package >
  <metadata>
    <id>DebugNuget2017</id>
    <version>1.0.2</version>
    <title>$title$</title>
    <authors>SUCHIL</authors>
    <owners>SUCHIL</owners>
    <description>This library will help you to learn Nuget Debugging</description>
    <releaseNotes>Checking something important</releaseNotes>
    <copyright>Copyright 2019</copyright>
    <tags>Learn,Nuget,Debugging</tags>
    <dependencies>
		<group targetFramework="uap10.0.16299">
			<dependency id="Microsoft.NETCore.UniversalWindowsPlatform" version="6.2.9" />
		</group>
    </dependencies>
  </metadata>
  <files>
	  <file src="bin\Debug\DebugNuget2017.dll" target="lib\uap10.0.16299\DebugNuget2017.dll" />
	  <file src="bin\Debug\DebugNuget2017.pdb" target="lib\uap10.0.16299\DebugNuget2017.pdb" />
	  <file src="bin\Debug\DebugNuget2017.pri" target="lib\uap10.0.16299\DebugNuget2017.pri" />
  </files>
</package>

Package command used is:

nuget pack DebugNuget2017.nuspec -Symbols -SymbolPackageFormat snupkg

I copied my nupkg and snupkg file to network path.

On another machine Visual Studio 2017 Debug settings in Options:

1. Symbols: Symbols cache directory set, Load all modules unless excluded is selected
2. General: Enable Just My Code is checked
3. General: Require source files to exactly match the original version

With same settings when I tried debugging nuget package on another machine, it use to download DebugNuget2017.pdb folder and show source code. But now it is not working and debug does not step into source code. Did I miss any point?

I even tried with Visual Studio 2019 and still could not debug nuget package. Am I missing any critical settings?

@chilakamarthi chilakamarthi changed the title Debug does not working - snupkg Debug does not load code files - snupkg Nov 12, 2019
@nkolev92 nkolev92 added Partner:VS-Other Resolution:Question This issues appears to be a question, not a product defect Area:Symbols labels Nov 12, 2019
@nkolev92
Copy link
Member

I don't think the debugger is really set-up to consume snupkgs from local NuGet feeds.

Where was the snupkg when you tried debugging from another machine?

//cc @rrelyea @loic-sharma @cristinamanum for help on this topic.

@nkolev92 nkolev92 added WaitingForCustomer Applied when a NuGet triage person needs more info from the OP and removed Resolution:Question This issues appears to be a question, not a product defect labels Nov 12, 2019
@cristinamanum
Copy link
Contributor

Consuming snupkgs from local feed is not supported. @chilakamarthi do you pack the pdbs in the nupkg as well?
If they are packed the scenario should work. Few things to try to debug:

  1. Please verify if the pdb is in the nupkg.
  2. If yes, please see if the pdb is copied to the local folder.
  3. If yes, in debug session open the Modules window and see if the symbols are loaded.

If the answer to step 1 is No, the nupkg and snupkg needs to be published to nuget.org.

@chilakamarthi
Copy link
Author

I don't think the debugger is really set-up to consume snupkgs from local NuGet feeds.

Where was the snupkg when you tried debugging from another machine?

//cc @rrelyea @loic-sharma @cristinamanum for help on this topic.

Consuming snupkgs from local feed is not supported. @chilakamarthi do you pack the pdbs in the nupkg as well?
If they are packed the scenario should work. Few things to try to debug:

  1. Please verify if the pdb is in the nupkg.
  2. If yes, please see if the pdb is copied to the local folder.
  3. If yes, in debug session open the Modules window and see if the symbols are loaded.

If the answer to step 1 is No, the nupkg and snupkg needs to be published to nuget.org.

This was working in Feb. I could debug and pdb was loaded, extracted into temp folder and code was shown. Even at that time, I was publishing my nuget packages to network path. I was trying to demo it to my team and realized its not working anymore.

@donnie-msft
Copy link
Contributor

@chilakamarthi is it possible that your Symbol sources changed between now and previous time it worked?
Check in VS: Tools -> Options -> Debugging -> Symbols. Under Symbol file (.pdb) locations, what do you have listed and are they checked/enabled?

We don't currently have NuGet capability of publishing snupkgs to a local feed, nor can they be directly consumed outside of a symbol server. So my guess is that you were at one time loading PDBs from a symbol server that you don't have setup today.

@chilakamarthi
Copy link
Author

chilakamarthi commented Nov 15, 2019

@chilakamarthi is it possible that your Symbol sources changed between now and previous time it worked?
Check in VS: Tools -> Options -> Debugging -> Symbols. Under Symbol file (.pdb) locations, what do you have listed and are they checked/enabled?

We don't currently have NuGet capability of publishing snupkgs to a local feed, nor can they be directly consumed outside of a symbol server. So my guess is that you were at one time loading PDBs from a symbol server that you don't have setup today.

I am pretty sure we did it from network share. We did demo to our customer in Sweden and they were happy to see working solution for the problem.

verifying the location, I have the path defined there in the list of sources to my network location.

And here is the link to issue where its discussed:

#6104 (comment)

@nkolev92 nkolev92 changed the title Debug does not load code files - snupkg Debugging locally with snupkgs Nov 15, 2019
@nkolev92 nkolev92 changed the title Debugging locally with snupkgs Debugging locally with snupkgs is difficult Nov 15, 2019
@nkolev92 nkolev92 added Triage:NeedsTriageDiscussion and removed Triage:NeedsTriageDiscussion WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Dec 31, 2019
@nkolev92 nkolev92 added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Feature and removed Triage:NeedsTriageDiscussion labels May 18, 2020
@godboutj
Copy link

That would be so awesome to not have to put the .snupkg on a Symbol server. I use artifactory I can distribute the .nupkg to my client and internally, but I wan to debug them internally without packaging them for the clients. If we could load the symbols package from a web source (with auth) or from a local folder at least, that would be great.

@GNUGradyn
Copy link

Are there plans to implement this? I have a local nuget folder that I put development versions of shared libraries in, I need to be able to load snuget packages from there along with their nuget packages so I have debug symbols.

@Zl7
Copy link

Zl7 commented Aug 25, 2022

Stumbled randomly here but I wonder if the option "Enable Just My Code" should not be "Unchecked" instead of "Checked".
My two cents.

@f-loeffler
Copy link

Does this still not work? How can we use symbol packages without having to set up a dedicated server for that?

@jasonleenaylor
Copy link

This feature would be very nice for local development of packages and package consumers, the workarounds are all a bit fragile. We can build locally and consume from a local package source, it makes sense and would be very convenient if snupkg files could work exactly the same.

@Varmod
Copy link

Varmod commented Dec 6, 2023

I've also ran into this issue trying to debug an external library from nuget.
For a quick fix I ended up unzipping the .snupkg and used the specific .pdb's I needed from the lib folder.

I had to restart visual studio to get the debugger to work because when VS tried to load the .pdb's from a local folder it complained that there was a version mismatch (which there shouldn't have been). After restarting it debugs correctly.

@dmn-star
Copy link

dmn-star commented Feb 7, 2024

I am working with Rrider on a MAUI app and I have not been able to debug the external libraries with local snupkg. Also adding PDB information and sources

<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</
AllowedOutputExtensionsInPackageBuildOutputFolder>

directly to NuGet package did not help.

@jeffkl jeffkl added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Triage:NeedsTriageDiscussion labels Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Symbols Partner:VS-Other Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:Feature
Projects
None yet
Development

No branches or pull requests