You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/debugging.md
+28-1Lines changed: 28 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,33 @@
2
2
3
3
For basics on how to set-up your repo and how to build the product, refer to the [contributing guide](../CONTRIBUTING.md).
4
4
5
+
## Debugging integration tests
6
+
7
+
The test projects Dotnet.Integration.Tests, MSBuild.Integration.Tests and NuGet.CommandLine.FuncTests all run NuGet in child processes.
8
+
This means you can't normally put breakpoints in the product code, since that code won't run in the test host.
9
+
However, there is a [Microsoft Child Process Debugging Power Tool](https://marketplace.visualstudio.com/items?itemName=vsdbgplat.MicrosoftChildProcessDebuggingPowerTool2022), which can automatically attach to child processes when debugging in Visual Studio.
10
+
11
+
As the extension says:
12
+
13
+
> The power tool requires a native debugger. This means if you are debugging .NET code, you must choose to enable mixed mode debugging (so managed and native)
14
+
15
+
It's the same to do this for test projects, or console apps, in the project property's debug settings.
If you don't see the process appear, then you need to check the extension's settings and check that mixed mode (native code) debugging is enabled.
30
+
If the child process does appear, it probably means that your breakpoints are in code that is not getting run.
31
+
5
32
## Debugging and testing NuGet.exe (NuGet.Commandline)
6
33
7
34
Given that it is a .NET Framework based x86 console application, NuGet.exe is straightforward to debug.
@@ -23,7 +50,7 @@ Testing the NuGet Visual Studio functionality is equally as easy as testing NuGe
23
50
The start-up project is [NuGet.VisualStudio.Client](../src/NuGet.Clients/NuGet.VisualStudio.Client/NuGet.VisualStudio.Client.csproj). Starting this project will build the VSIX, then install that VSIX onto and launch your [experimental instance](https://docs.microsoft.com/en-us/visualstudio/extensibility/the-experimental-instance) of Visual Studio.
24
51
25
52
> Note: NuGet's integration into Visual Studio depends on Visual Studio components. When testing this integration it is important that the version of NuGet being tested and the Visual Studio instance are compatible. The [release notes](https://learn.microsoft.com/nuget/release-notes/) contain the exact mapping, where the minor version of NuGet matches the minor version of Visual Studio, example 17.12 of Visual Studio matches 6.12 of NuGet.
26
-
Testing NuGet 6.12 on top of 17.8 for example is not guaranteed to work.
53
+
Testing NuGet 6.12 on top of 17.8 for example is not guaranteed to work.
27
54
Only testing 6.12 on top of 17.12 is expected to consistently work.
0 commit comments