I have a barebones C++ project, in which I have embedded Mono according to the documentation.
I have then created a simple .cs file with a class with a couple of test functions that print some strings. I compile this file with the this command:
mcs SomeClass.cs -debug -target:library
As expected, I get a C# SomeClass.dll and a debug symbol file SomeClass.dll.mbd.
I can load the dll assembly from C++ (from the embedded Mono runtime) and call the functions inside the dll. I can step through the native code (C++) in VS Code. However, I can't figure it out how to step through/debug the managed C# code.
I imagined that I could launch the program, step through native code, then attach to Mono and step through managed C# code. However, the embedded Mono runtime always terminates the native program with this error message:
debugger-agent: Unable to connect to 127.0.0.1:55555
I am at a total loss. I can debug pure C# code, without any embedded Mono runtime, I can debug native code. However, I can not debug any C# code that is executed in a embedded Mono runtime.
Ideally I would like to step through both C++ & C# seamlessly, just like how Visual Studio can. However, I would be quite content if I could at least be able to debug either native code or managed C# code, one at a time. Unfortunately the latter doesn't seem to be working.
I have a barebones C++ project, in which I have embedded Mono according to the documentation.
I have then created a simple .cs file with a class with a couple of test functions that print some strings. I compile this file with the this command:
As expected, I get a C# SomeClass.dll and a debug symbol file SomeClass.dll.mbd.
I can load the dll assembly from C++ (from the embedded Mono runtime) and call the functions inside the dll. I can step through the native code (C++) in VS Code. However, I can't figure it out how to step through/debug the managed C# code.
Here's the meat of my launch.json file:
I also pass some command line options to the embedded Mono runtime:
I imagined that I could launch the program, step through native code, then attach to Mono and step through managed C# code. However, the embedded Mono runtime always terminates the native program with this error message:
I am at a total loss. I can debug pure C# code, without any embedded Mono runtime, I can debug native code. However, I can not debug any C# code that is executed in a embedded Mono runtime.
Ideally I would like to step through both C++ & C# seamlessly, just like how Visual Studio can. However, I would be quite content if I could at least be able to debug either native code or managed C# code, one at a time. Unfortunately the latter doesn't seem to be working.