-
I am trying to run this in a docker image Alpine:3.15 with dotnet6 installed and a manual build of netcoredbg. I wonder how to pass env to netcoredbg beacuse when I run it from cli and set
My adapter config dap.adapters.netcoredbg = {
type = 'executable',
command = '/tmp/dotnet/netcoredbg/netcoredbg',
args = {'--interpreter=vscode'},
options = {
env = {
ASPNETCORE_ENVIRONMENT = 'Development',
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1,
},
},
} My launch config: dap.configurations.cs = {
{
type = 'netcoredbg',
name = 'attach - netcoredbg',
request = 'attach',
processId = require("dap.utils").pick_process,
},
} I start my program in nvim terminal like this: export ASPNETCORE_ENVIRONMENT='Development'
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
cd web-test-5.0/bin/debug/net6.0
dotnet web-test-5.0.dll Check that it works from terminal and it respond with data
Go back to nvim and set breakpoints through dap dap log with the the error System.Globalization.Invariant [ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:851 ] "request" {
arguments = {
adapterID = "nvim-dap",
clientId = "neovim",
clientname = "neovim",
columnsStartAt1 = true,
linesStartAt1 = true,
locale = "en_US",
pathFormat = "path",
supportsRunInTerminalRequest = true,
supportsVariableType = true
},
command = "initialize",
seq = 0,
type = "request"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = {
capabilities = {
exceptionBreakpointFilters = { {
filter = "user-unhandled",
label = "user-unhandled"
}, {
filter = "all",
label = "all"
} },
supportTerminateDebuggee = true,
supportsConditionalBreakpoints = true,
supportsConfigurationDoneRequest = true,
supportsExceptionFilterOptions = true,
supportsExceptionInfoRequest = true,
supportsExceptionOptions = false,
supportsFunctionBreakpoints = true,
supportsSetExpression = true,
supportsSetVariable = true,
supportsTerminateRequest = true
}
},
event = "capabilities",
seq = 1,
type = "event"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = vim.empty_dict(),
event = "initialized",
seq = 2,
type = "event"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = {
exceptionBreakpointFilters = { {
filter = "user-unhandled",
label = "user-unhandled"
}, {
filter = "all",
label = "all"
} },
supportTerminateDebuggee = true,
supportsConditionalBreakpoints = true,
supportsConfigurationDoneRequest = true,
supportsExceptionFilterOptions = true,
supportsExceptionInfoRequest = true,
supportsExceptionOptions = false,
supportsFunctionBreakpoints = true,
supportsSetExpression = true,
supportsSetVariable = true,
supportsTerminateRequest = true
},
command = "initialize",
request_seq = 0,
seq = 3,
success = true,
type = "response"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:851 ] "request" {
arguments = {
breakpoints = { {
line = 29,
state = {
id = 1,
line = 29,
message = "The breakpoint is pending and will be resolved when debugging starts.",
verified = false
}
}, {
line = 32,
state = {
id = 2,
line = 32,
message = "The breakpoint is pending and will be resolved when debugging starts.",
verified = false
}
} },
lines = { 29, 32 },
source = {
name = "WeatherForecastController.cs",
path = "/projects/tm-logging/web-test-5.0/Controllers/WeatherForecastController.cs"
}
},
command = "setBreakpoints",
seq = 1,
type = "request"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:851 ] "request" {
arguments = {
name = "attach - netcoredbg",
processId = 667,
request = "attach",
type = "netcoredbg"
},
command = "attach",
seq = 2,
type = "request"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = {
breakpoints = { {
id = 1,
line = 29,
message = "The breakpoint is pending and will be resolved when debugging starts.",
verified = false
}, {
id = 2,
line = 32,
message = "The breakpoint is pending and will be resolved when debugging starts.",
verified = false
} }
},
command = "setBreakpoints",
request_seq = 1,
seq = 4,
success = true,
type = "response"
}
[ DEBUG ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = vim.empty_dict(),
command = "attach",
request_seq = 2,
seq = 5,
success = true,
type = "response"
}
[ INFO ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:497 ] "Server rejected breakpoint" {
id = 1,
line = 29,
message = "The breakpoint is pending and will be resolved when debugging starts.",
verified = false
}
[ INFO ] 2022-02-20T19:59:27Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:497 ] "Server rejected breakpoint" {
id = 2,
line = 32,
message = "The breakpoint is pending and will be resolved when debugging starts.",
verified = false
}
[ DEBUG ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:851 ] "request" {
arguments = {
filters = {}
},
command = "setExceptionBreakpoints",
seq = 3,
type = "request"
}
[ DEBUG ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = vim.empty_dict(),
command = "setExceptionBreakpoints",
request_seq = 3,
seq = 6,
success = true,
type = "response"
}
[ DEBUG ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:851 ] "request" {
command = "configurationDone",
seq = 4,
type = "request"
}
[ DEBUG ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:561 ] {
body = vim.empty_dict(),
command = "configurationDone",
request_seq = 4,
seq = 7,
success = true,
type = "response"
}
[ ERROR ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:762 ] "stderr" {
args = { "--interpreter=vscode" },
command = "/tmp/dotnet/netcoredbg/netcoredbg",
options = {
env = {
ASPNETCORE_ENVIRONMENT = "Development",
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1
}
},
type = "executable"
} "Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information.\n at System.Environment.FailFast(System.String)\n at System.Globalization.GlobalizationMode+Settings..cctor()\n at System.Globalization.CultureData.CreateCultureWithInvariantData()\n"
[ ERROR ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:762 ] "stderr" {
args = { "--interpreter=vscode" },
command = "/tmp/dotnet/netcoredbg/netcoredbg",
options = {
env = {
ASPNETCORE_ENVIRONMENT = "Development",
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1
}
},
type = "executable"
} " at System.Globalization.CultureData.get_Invariant()\n at System.Globalization.CultureInfo..cctor()\n at System.Globalization.CultureInfo.get_CurrentCulture()\n at System.String.LastIndexOf(System.String, Int32, Int32, System.StringComparison)\n at System.String.LastIndexOf(System.String)\n at NetCoreDbg.SymbolReader.TryOpenReaderFromCodeView(System.Reflection.PortableExecutable.PEReader, System.Reflection.PortableExecutable.DebugDirectoryEntry, System.String)\n at NetCoreDbg.SymbolReader.TryOpenReaderFromAssembly(System.String, Boolean, System.IO.Stream)\n at NetCoreDbg.SymbolReader.GetReader(System.String, Boolean, System.IO.Stream, System.IO.Stream)\n at NetCoreDbg.SymbolReader.LoadSymbolsForModule(System.String, Boolean, UInt64, Int32, UInt64, Int32, ReadMemoryDelegate)\n"
[ INFO ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:730 ] "Closed all handles"
[ INFO ] 2022-02-20T19:59:31Z+0000 ] /home/dev_user/.vim/plugged/nvim-dap/lua/dap/session.lua:733 ] "Process closed" 720 false Any ideas what I am doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I did have to add the ICU lib even if I don't think I should have to, it should just be to set env This is what I did:
Now its online but I still don't hit any breakpoints :) |
Beta Was this translation helpful? Give feedback.
-
Now it stops on breakpoints as well. I needed to toggle my breakpoints after I attach to the process because it did invalidate them. Someone know why it works like that? |
Beta Was this translation helpful? Give feedback.
I did have to add the ICU lib even if I don't think I should have to, it should just be to set env
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
:)This is what I did:
Now its online but I still don't hit any breakpoints :)