An open source, cross platform .NET debugger implementing the VS Code Debug Adapter Protocol (DAP), completely written in C#!
SharpDbg uses ICorDebugSharp, a managed wrapper around the ICorDebug APIs.
This repository is the lextudio fork of SharpDbg (MattParkerDev/sharpdbg, upstream). It tracks upstream but carries a large functional delta: Edit and Continue / Hot Reload, client-side symbols and decompilation of external code, goto targets, restart, breakpoint locations, loaded sources, single-thread stepping, logpoints, source link, embedded sources, source file maps and more (see Fork vs. upstream). The fork targets .NET 11; upstream targets .NET 10.
SharpDbg is available on NuGet as a .NET Tool: https://www.nuget.org/packages/SharpDbg.Cli
dotnet tool install --global SharpDbg.Cli Once installed, run it using:
sharpdbg --interpreter=vscodeThe in memory library is also published to NuGet: https://www.nuget.org/packages/SharpDbg
See COMPARISON.md for the detailed feature matrix and the fork-vs-upstream differences.
SharpDbg is organized into three main components:
┌─────────────────────────────────────────────────────────┐
│ VS Code / DAP Client │
└────────────────────────────┬────────────────────────────┘
│ DAP (stdin/stdout)
┌────────────────────────────▼────────────────────────────┐
│ SharpDbg.Cli │
│ • Entry point and command-line argument handling │
│ • DAP protocol client initialization │
└────────────────────────────┬────────────────────────────┘
│
┌────────────────────────────▼────────────────────────────┐
│ SharpDbg.Application │
│ • DAP protocol implementation │
│ • VS Code protocol message handlers │
│ • Event communication (stopped, continued, etc.) │
└────────────────────────────┬────────────────────────────┘
│
┌────────────────────────────▼────────────────────────────┐
│ SharpDbg.Infrastructure │
│ • Core debugger engine (ManagedDebugger) │
│ • ICorDebug API wrapper (ICorDebugSharp) │
│ • Breakpoint and variable management │
│ • Expression evaluator (compiler + interpreter) │
└─────────────────────────────────────────────────────────┘
- Ensure .NET 11 SDK is installed
- git clone
dotnet build- Done!
This will produce the debug adapter executable at artifacts/bin/SharpDbg.Cli/debug/SharpDbg.Cli, equivalent to netcoredbg.exe
[DebuggerDisplay("Count = {Count}")]
public class List<T> : IList<T>, IList, IReadOnlyList<T>DebuggerTypeProxy & DebuggerBrowsable(.RootHidden) attributes
[DebuggerTypeProxy(typeof(ICollectionDebugView<>))]
public class List<T> : IList<T>, IList, IReadOnlyList<T>- ICorDebugSharp - Managed wrappers around the ICorDebug API
- netcoredbg - .NET debugger, written in C++
- DNCDbg - Managed-code .NET debugger with DAP support (NetCoreDbg fork)
- csdbg - C#/.NET 10 reimplementation of netcoredbg
- debug-adapter-protocol - Microsoft's VS Code Debug Adapter Protocol