0

As title says, I have 2 solutions open. The first solution (which contains an API project I start a new debugging session of) allows me to step through, no problem.

As part of a web request to this API, it calls off to a service which belongs to a nuget package. I also own this nuget package, I have it open in a new window.

I obviously can't attach the nuget package code to that process since there's already a debugger attached. But I own the other code, so the symbols are there to step through.

Question

How do I step into the other nuget project as part of debugging the API?

What I've Tried

Running the API process (without a debugger attached) allowing me to then attach the nuget project. This might work, but I also want to debug the first.

JᴀʏMᴇᴇ
  • 218
  • 2
  • 15
  • You _could_ add the "nuget package code" as a project to the solution of your API and then change the API's references to now reference the project instead of the nuget package. It's not very convenient, but I do it from time to time when I find I need to do the same thing. – Timothy G. Mar 26 '23 at 00:41
  • You may also want to read https://stackoverflow.com/questions/44457552/how-to-debug-code-in-nuget-package-created-by-me – Timothy G. Mar 26 '23 at 00:42

1 Answers1

0

Timothy's suggestion is a feasible. Find the source code of the nuget package, and add it as the project reference to your current project, after that, you will be able to debug to another one(Press F11 after hit the breakpoint during the debugging step in your current project).

Your .csproj file should be like this:

  <ItemGroup>
    <ProjectReference Include="..\xxx\xxx.csproj" />
  </ItemGroup>
Bowman Zhu-MSFT
  • 4,776
  • 1
  • 9
  • 10