This guide describes how to integrate .NET Core debugging in Neovim using nvim-dap and netcoredbg.
To start debugging do the following. Ensure you have configured the code below
Dont start the project before doing this, debugger has to start it for you
- Open any
.csfile in the project - Set a breakpoint with
<leader>b - Press
<F5> - Select the project you want to debug (if your breakpoint is in a library you have to select the entry point project)
- Wait for breakpoint to be hit
- You can now
<F10>step over,<F11>step into,<F5>continue and more (see code)
The only thing required for easy-dotnet to automatically configure dap for you is that you supply the bin_path option in options.debugger.bin_path
--lazy.nvim
-- easy-dotnet config
return {
"GustavEikaas/easy-dotnet.nvim",
dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
config = function()
local dotnet = require "easy-dotnet"
dotnet.setup {
debugger = {
--name if netcoredbg is in PATH or full path like 'C:\Users\gusta\AppData\Local\nvim-data\mason\bin\netcoredbg.cmd'
bin_path = "netcoredbg",
}
}
end
}--lazy.nvim
--nvim-dap config
return {
"mfussenegger/nvim-dap",
config = function()
local dap = require "dap"
-- Keymaps for controlling the debugger
vim.keymap.set("n", "q", function()
dap.terminate()
dap.clear_breakpoints()
end, { desc = "Terminate and clear breakpoints" })
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Start/continue debugging" })
vim.keymap.set("n", "<F10>", dap.step_over, { desc = "Step over" })
vim.keymap.set("n", "<F11>", dap.step_into, { desc = "Step into" })
vim.keymap.set("n", "<F12>", dap.step_out, { desc = "Step out" })
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
vim.keymap.set("n", "<leader>dO", dap.step_over, { desc = "Step over (alt)" })
vim.keymap.set("n", "<leader>dC", dap.run_to_cursor, { desc = "Run to cursor" })
vim.keymap.set("n", "<leader>dr", dap.repl.toggle, { desc = "Toggle DAP REPL" })
vim.keymap.set("n", "<leader>dj", dap.down, { desc = "Go down stack frame" })
vim.keymap.set("n", "<leader>dk", dap.up, { desc = "Go up stack frame" })
-- .NET specific setup using `easy-dotnet`
require("easy-dotnet.netcoredbg").register_dap_variables_viewer() -- special variables viewer specific for .NET
end
}Debugging in statically typed languages like C# often involves navigating deeply nested runtime types such as List<T>, Dictionary<K,V>, or HashSet<T>. While tools like nvim-dap-ui provide a fantastic general-purpose interface for any language, they can’t always interpret the internal structure of .NET collections in a way that's intuitive to the user.
This plugin includes a custom variables viewer tailored specifically for the .NET ecosystem. It automatically unwraps common C# types, displaying concise, human-readable summaries of your data structures during debugging—no need to drill into private fields like _items, _size, or internal buckets.
This dramatically improves the debugging experience for C# and F# developers using Neovim.
Out of the box, the following .NET types are recognized and automatically prettified:
System.Collections.ObjectModel.ReadOnlyCollectionSystem.Collections.Generic.ListSystem.Collections.Generic.SortedListSystem.Collections.Immutable.ImmutableListSystem.Collections.Concurrent.ConcurrentDictionarySystem.Collections.Generic.DictionarySystem.Collections.Generic.OrderedDictionarySystem.Collections.ObjectModel.ReadOnlyDictionarySystem.Collections.Generic.HashSetSystem.Collections.Generic.QueueSystem.Collections.Generic.StackSystem.DateOnlySystem.DateTimeSystem.DateTimeOffsetSystem.TimeOnlySystem.TimeSpanSystem.EnumSystem.VersionSystem.RuntimeTypeSystem.UriSystem.ExceptionSystem.GuidSystem.Tuple<>System.Text.Json.JsonElementSystem.Text.Json.Nodes.JsonArraySystem.Text.Json.Nodes.JsonObjectNewtonsoft.Json.Linq.JArrayNewtonsoft.Json.Linq.JObjectNewtonsoft.Json.Linq.JPropertyNewtonsoft.Json.Linq.JValue
Simply call this function during your DAP setup:
require("easy-dotnet.netcoredbg").register_dap_variables_viewer()If you encounter a type that isn’t yet handled, feel free to open an issue. Community contributions are always welcome!
Easy preview of variables while debugging, unwraps complex types

Let's you view and expand more complex variables. With automatic unwrapping
