-
-
Notifications
You must be signed in to change notification settings - Fork 44
cs compiler
After compiling your C# project, you can use DAP to debug it. To do so, create a .profile file in your working directory. Then pass the -debug parameter to the compier like this
[HELLO WORLD]
entry_point="/path/to/my/entry_point_file/main.c"
output="/path/where/the/program/will/be/written/hello_world"
parameters="-debug"
If it has worked, after compiling your program you will se the file Program.dpb beside your executable.
Please note that this section has nothing to do with compiler.nvim. I'm documenting the process to make your life easier. To debug C# with DAP you need to
- Install the package
netcoredbgin your system - Setup
DAPfor C# - Create the next file in the directory of your executable
{
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true,
"System.GC.Concurrent": true,
"System.Threading.ThreadPool.MinThreads": 1,
"System.Threading.ThreadPool.MaxThreads": 1
},
"tfm": "netcoreapp2.1",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "7.0.9"
},
"applyPatches": true,
"rollForwardOnNoCandidateFx": 1
}
}But instead of version 7.0.9, use the Microsoft.NETCore.App version you have installed in your system. (on arch you can check it on the directory/usr/share/dotnet/shared/Microsoft.NETCore.App/)
Compile your program, add a breakpoint to your code, and then run DAP. You will see something like this

Congratulations, now you can compile and debug C#.