microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.52k stars 1.55k forks source link

Included mono libraries interfere with applications that embed mono/xamarin.mac #6682

Open cwensley opened 3 years ago

cwensley commented 3 years ago

Type: Debugger

Describe the bug

When debugging an application that embeds mono, the MONO_PATH environment variable that is set during debugging in debugAdapters/OpenDebugAD7 causes the application's embedded mono to use the assemblies included in this extension instead of their own. This environment variable should be avoided, or unset before launching the application.

To Reproduce This is my launch.json:

        {
            "name": "Launch My App",
            "type": "cppdbg",
            "request": "launch",
            "program": "/path/to/MyApp.app/Contents/MacOS/MyApp",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "externalConsole": false,
            "MIMode": "lldb",
        }

An easy way to avoid this problem I found is to add this line to launch.json, but it should not be necessary:

            "environment": [ { "name": "MONO_PATH", "value": "" }]
WardenGnaw commented 3 years ago

Thank you for reporting this bug. We are looking to migrate the debugger binaries to use .net core. This migration will fix this issue.

cwensley commented 3 years ago

Perfect! 👍 Thanks for the quick response.