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
@@ -40,39 +40,3 @@ Ensure that you have configured PowerShell to be able to run local unsigned scri
40
40
You can get a list of options:
41
41
42
42
`./build --help`
43
-
44
-
## Debugging
45
-
46
-
Debugging the VS Adapter is tricky. There are two ways to do it depending on whether you want to do it under `net472` or `net6.0`. In all cases, you'll currently need to build your own test adapter NuGet package using `./build.ps1 Build` first to ensure you have local symbols. The symbols are not in the public package. It's helpful to add it to a local `\packages` directory and then use an entry like `<add key="Local Packages" value=".\packages" />` in your `NuGet.config` file to point to it. Don't forget to eventually delete it from your global profile `.nuget\packages\xunit...` when you're done.
47
-
48
-
### `net472`
49
-
Easiest thing to do is add a `launchSettings.json` file that adds the `vstest.console.exe` as a startup project and point it to an xunit dll. Something like the following (use `/listtests` if you just want to debug the discovery portion):
With that as the startup project, you can set breakpoints and then hit them. You may need to manually load symbols the first time if it's not detected automatically.
64
-
65
-
### `net6.0`
66
-
67
-
Debugging the .NET Core version of the runner is currently much more difficult. You'll need [Process Explorer](https://technet.microsoft.com/en-us/sysinternals/processexplorer.aspx) to help locate the correct process to debug. This limitation should be improved in subsequent .NET Test Platform releases.
68
-
69
-
1. Start a PowerShell console and navigate to the directory with your test project
70
-
2. Set an environment variable in that console session: `$env:VSTEST_HOST_DEBUG = 1`
71
-
3. Build your test project: `dotnet build`
72
-
4. Have VS open with the xUnit solution loaded
73
-
5. Have Process Explorer open and in Tree View mode. You may want to update the "highlight delay" settings to 2-3 settings. Defaults to 1. Make the list scroll roughly to the "d's"
74
-
6. Execute the test: `dotnet vstest .\bin\debug\net6.0\MyTest.dll` (you can use the `-lt` switch to do discovery only)
75
-
7. The test adapter will wait for about 30 seconds for you to attach a debugger. You need to look for the "lowest" `dotnet.exe` process in the tree like this: . In this case, the PID you're looking for is `79404`.
76
-
8. In VS, go to Debug -> Attach to Process and look for the PID (easiest to sort the column by PID). Ensure the debugger type is "Automatic" and it'll choose the CoreCLR debugger.
77
-
9. Attach and then quickly hit Continue. It should load up the adapter and related code with symbols.
0 commit comments