I am trying to debug my c# app with neovim DAP. Here is my configs:
local dap = require('dap')
dap.adapters.coreclr = {
type = 'executable',
command = '/home/asd/netcoredbg/netcoredbg',
args = { '--interpreter=vscode' },
}
dap.configurations.cs = {
{
type = "coreclr",
name = "launch - netcoredbg",
request = "launch",
program = function()
-- return vim.fn.input('Path to dll', vim.fn.getcwd() .. '/bin/Debug/', 'file')
return vim.fn.input('Path to dll: ')
end
},
}
When i run DAP with my dll, I get these errors:

I tried to use netcoredbg cli tool separately, like this: ~/netcoredbg/netcoredbg --interpreter=cli -- dotnet run ./bin/Debug/net7.0/WebApi.dll environment=DevelopmentLocalhost and everything works fine.
So i pretty sure that my dap configs are wrong. Thanks for help!
UPD: I answered my actual question below. BUT! The last question remains: is there a way to setup dap to just use launch.json generated by VsCode and how to do that?
So.. I get it working with configs like this:
So key thing here is that we pass envs using
envproperty ofcsconfig object. Just like other fields it can be exact value, or can be a function where we can e.g. get input from ui and then use as a value for env variable:or
Also, its important to set
cwd, e.g. becauseappsettings.jsonwill be searched there