Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up the visual studio code launch.json file to debug F#?

How do I set up the debugger in launch.json?

Currently, I have

{
    "version": "0.1.0",
    "configurations": [
        {
            // Name of configuration
            // Appears in the launch configuration drop down menu.
            "name": "Launch Lukecxu",
            "request": "launch",
            "cwd": "/Users/lukexu/lukecxu",
            "type": "node",
            // Automatically stop program after launch.
            "stopOnEntry": true,
            "program": "${workspaceRoot}" 
        }
    ]
}

I found some of this online but it's not working. It said I should have "type" as mono but when I set it has mono it said type not supported.

For my system settings I did brew install mono and I also have ionide installed.

Right now I can't click the gutter to set any break points and when I hit F5 it says "Cannot launch program '/Users/lukexu/lukecxu'; configuring source maps might help."

Is there a tutorial to set up F# debugger in VSCode?

like image 287
Luke Xu Avatar asked Jun 26 '16 05:06

Luke Xu


People also ask

How do I Debug json in Visual Studio?

Once you have your launch configuration set, start your debug session with F5. Alternatively, you can run your configuration through the Command Palette (Ctrl+Shift+P) by filtering on Debug: Select and Start Debugging or typing 'debug ' and selecting the configuration you want to debug.

How do I use Visual Studio launch json code?

In Visual Studio Code, use shortcut Ctrl + Shift + P to open the Command Palette and type Open launch. json . And it will open the launch.

Where do I put launch json vscode?

The launch. json file is located in a . vscode folder in your workspace (project root folder).


1 Answers

I think that you need to install mono debug extension

After you've installed extension following configuration should work:

{
    "version": "0.1.0",
    "configurations": [
        {
            // optional "preLaunchTask": "Build" - some way of building your application.
            "externalConsole": true, 
            "name": "Launch",
            "type": "mono",
            // Workspace relative or absolute path to the program.
            "program": "${workspaceRoot}/bin/myapp/myapp.exe",
            "stopOnEntry": true
        },
        {
            "name": "Attach",
            "request": "attach",
            "type": "mono",
            "address": "localhost",
            "port": 55555
        }
    ]
}
like image 86
Krzysztof Cieslak Avatar answered Oct 01 '22 14:10

Krzysztof Cieslak