mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
* Move files into hierarchy * fix more links * Fix botr and features links * Remove bad apostrophe * spelling * Apply suggestions from code review Co-Authored-By: Youssef Victor <[email protected]> * Update docs/coding-guidelines/package-projects.md Co-Authored-By: Jan Kotas <[email protected]> Co-authored-by: Youssef Victor <[email protected]> Co-authored-by: Jan Kotas <[email protected]>
1.7 KiB
1.7 KiB
Debugging Libraries with Visual Studio Code
- Install Visual Studio Code
- Install the C# Extension
- Open the folder containing the source you want to debug in VS Code - i.e., if you are debugging a test failure in System.Net.Sockets, open
runtime/src/libraries/System.Net.Sockets - Open the debug window:
ctrl-shift-Dor click on the button on the left - Click the gear button at the top to create a launch configuration, select
.NET Corefrom the selection dropdown - In the
.NET Core Launch (console)configuration do the following- delete the
preLaunchTaskproperty - set
programto the full path todotnetin the artifacts/bin/testhost directory.- something like
runtime/artifacts/bin/testhost/netcoreapp-{OS}-{Configuration}-{Architecture}, plus the full path to your corefx directory.
- something like
- set
cwdto the test bin directory.- using the System.Net.Sockets example, it should be something like
runtime/artifacts/bin/System.Net.Sockets.Tests/netcoreapp-{OS}-{Configuration}-{Architecture}, plus the full path to your corefx directory.
- using the System.Net.Sockets example, it should be something like
- set
argsto the command line arguments to pass to the test- something like:
[ "exec", "--runtimeconfig", "{TestProjectName}.runtimeconfig.json", "xunit.console.dll", "{TestProjectName}.dll", "-notrait", ... ], where TestProjectName would beSystem.Net.Sockets.Tests - to run a specific test, you can append something like:
[ "method", "System.Net.Sockets.Tests.{ClassName}.{TestMethodName}", ...]
- something like:
- delete the
- Set a breakpoint and launch the debugger, inspecting variables and call stacks will now work