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

Can't debug into GAX NuGet packages #591

Closed
jskeet opened this issue Sep 6, 2022 · 10 comments
Closed

Can't debug into GAX NuGet packages #591

jskeet opened this issue Sep 6, 2022 · 10 comments
Assignees
Labels
type: process A process-related concern. May include testing, release, or the like.

Comments

@jskeet
Copy link
Collaborator

jskeet commented Sep 6, 2022

Our .nupkg files contain pdbs, but for some reason I'm not able to step into them in the debugger.
It's possible this is just with local package sources, but we should investigate.

@jskeet jskeet self-assigned this Sep 6, 2022
@jskeet jskeet added the type: process A process-related concern. May include testing, release, or the like. label Sep 6, 2022
@jskeet
Copy link
Collaborator Author

jskeet commented Sep 7, 2022

Sample .NET 6 console app - I can't step into RetrySettings.FromConstantBackoff:

using Google.Api.Gax.Grpc;

var ts = TimeSpan.FromMinutes(1);
Predicate<Exception> predicate = ex => false;
var settings = RetrySettings.FromConstantBackoff(10, ts, predicate);
var backoff = settings.NextBackoff(TimeSpan.Zero);

Will investigate other packages we (or I) publish (which may have different settings). Packages to check:

  • NodaTime
  • GAPIC libraries
  • REST support libraries
  • REST generated libraries
  • Functions Framework
  • Event type library (Google.Events.Protobuf)
  • Protobuf

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 16, 2022

Interestingly, SourceLink does work when hitting F12 with the cursor on "FromConstantBackoff".

Just tested Noda Time as well with Instant instant = Instant.FromUtc(2022, 9, 16, 0, 0); - same behavior. The debugger just steps over the code. (I have "Just my code" unchecked in the debugging options.)

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 16, 2022

I can step into Json.NET code. But not:

  • Google.Protobuf
  • CloudNative.CloudEvents
  • Google.Api.Gax.Grpc
  • Google.Apis.Auth
  • Google.Apis.Storage.v1
  • Google.Cloud.Functions.V2
  • NodaTime

Hmm.

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 27, 2022

It's possible that this is due to not using Portable PDB files. See https://endjin.com/blog/2022/05/debugging-nuget-packages-understanding-debugging-symbols-and-using-source-link

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 27, 2022

I've tried publishing with portable PDBs (JonSkeet.DemoUtil) - no joy. It's really unclear to me what's going on here.

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 27, 2022

Aha - I think the problem is that dotnet build doesn't copy the pdb files into the output directory, and doesn't look for them from the package cache.

I suspect all of this is related to dotnet/sdk#1458, which looks like it enables a workaround via a new project property (CopyDebugSymbolFilesFromPackages=true) but only as of .NET SDK 7.0.100 RC2. I'm going to test that on my personal machine.

Assuming that doesn't become the default, we might want to consider publishing snupkg files instead, as it looks like that does already work out of the box.

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 27, 2022

(Ah - 7.0 RC2 isn't out yet. Only 7.0 RC1 is available right now.)

@jskeet
Copy link
Collaborator Author

jskeet commented Sep 27, 2022

Publishing a snuget package, I can navigate to the code, but I still can't debug into it :(

@jskeet
Copy link
Collaborator Author

jskeet commented Nov 22, 2022

Retested with .NET 7 and VS 2022 version 17.4.1 - still broken by default.

But, importantly, setting CopyDebugSymbolFilesFromPackages to true does fix this. Hooray! I think we can just document this for now.

@jskeet
Copy link
Collaborator Author

jskeet commented Dec 7, 2022

@jskeet jskeet closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

1 participant