-
Notifications
You must be signed in to change notification settings - Fork 673
Desktop .NET Framework
The C# extension supports limited full .NET framework debugging. It can only debug 64-bit applications with portable PDBs.
To enable the Desktop CLR debugger, change the configuration type in launch.json to be "clr" instead of "coreclr" and program should be pointing at the exe (NOT a .dll).
For unit tests, this can be done thusly:
- File->Preferences->Settings
- Open "CSharp: Unit Test Debugging Options"
- Set the 'type' to 'clr' (see settings.json example below)
- NOTE: For MSTest projects, also see Forcing MSTest projects to use a 64-bit worker section.
{
...
"type": "clr",
"program": "path\\to\\program.exe",
...
}
More information about debugging desktop .NET Framework can be found here, https://stackoverflow.com/questions/47707095.
{
...
"csharp.unitTestDebuggingOptions": {
"type": "clr"
}
}
Some versions of MSTest will use an x86 worker process to run tests, which is not supported by the debugger. This can result in error messages like: Unable to start program '<some-path-here>\\testhost.net472.x86.exe'. Unknown Error: 0x80131c30
or Unable to start program '<some-path-here>\\testhost.net472.x86.exe'. The .NET debugger can only debug x64 processes.
.
To fix this:
- Create a '.runsettings' file such as the following
- Add/modify a 'settings.json' file in the root of the workspace that points at the .runsettings file:
"omnisharp.testRunSettings": "C:\\My-workspace-root-here\\UseX64Worker.runsettings"
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<TargetPlatform>x64</TargetPlatform>
</RunConfiguration>
</RunSettings>
Configuration
- Configuring Snap installs of dotnet-sdk
- Configuring Arch Linux for Unity development
- Configuring Arch Linux for Razor development
- Installing the .NET Core Debugger on Arch Linux
Debugger
- Overview
- launch.json Help
- Feature List
- Enable Logging
- Portable PDBs
- Troubleshoot Breakpoints
- Attaching to remote processes
- Remote Debugging On Linux-Arm
- Windows Subsystem for Linux
- Diagnosting 'Debug adapter process has terminated unexpectedly'
- Testing libicu compatibility on Linux
- Debugging into the .NET Runtime itself
- Debugging x64 processes on an arm64 computer
Documentation
- Change Log
- Branches and Releases
- Installing Beta Releases
- Installing without internet connectivity
- Linux Support
- Run/Debug Unit Tests
- Troubleshooting: 'The .NET Core SDK cannot be located.' errors
Developer Guide