Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoints are not hitting while debugging F# console application in VSCode using Mono Debug extension #23

Open
vrnithinkumar opened this issue Mar 24, 2017 · 3 comments · May be fixed by MarcelRaschke/vscode-mono-debug#4
Labels

Comments

@vrnithinkumar
Copy link

While trying to debug a f# console application the break points are not hitting, its just launching the application in VSCode debug mode and finishing the execution.

VS Code : 1.10.2
Mono Debug : 0.15.3

launch.json

{
    "version": "0.2.0",
    "configurations": [
        
        {
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "C:/FSharp/test/TestFharp/bin/Debug/TestFharp.exe",
            "args": ["Test Arg"],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": "",
            "runtimeExecutable": null,
            "env": {},
            "externalConsole":false 
        },
        {
            "name": "Attach",
            "type": "mono",
            "request": "attach",
            "address": "localhost",
            "port": 55555
        }
    ]
}

DEBUG CONSOLE Output:
mono --debug --debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:54579 C:/FSharp/test/TestFharp/bin/Debug/TestFharp.exe "Test Arg"

  • Why is address=127.0.0.1:54579 coming as this even I configured the port as 55555 in launch,json ?
  • Is break points are not hitting because of address mismatch ? How do I make sync these ?

Link to Stack Overflow question : http://stackoverflow.com/questions/42929225/breakpoints-are-not-hitting-while-debugging-f-console-application-in-vscode-usi

@weinand weinand self-assigned this Mar 24, 2017
@weinand
Copy link
Contributor

weinand commented Jun 15, 2017

@vrnithinkumar your launch.json contains two configurations: one for launching the target (name: "Launch"), one for attaching to an already launched target (name: "Attach"). They are independent from each other.
From the debug console output I see that you are using the "Launch" launch configuration. In this launch configuration no "port" is specified and mono-debug will use a random port (54579 in your case). So there is no port mismatch.

How did you compile your F# program?
Make sure that you compile it for debugging.

@ghost
Copy link

ghost commented Oct 23, 2017

@weinand Maybe I have a similar issue.

I currently have this, it starts my app and it shows in the debug panel that threads are running but breakpoints don't work

{
            "name": "Launch",
            "type": "mono",
            "request": "launch",
            "program": "${workspaceRoot}/../Build/Client/SC_WebApp.exe",
            "args": ["--dev-mode", "--disable-ui"],
            "cwd": "${workspaceRoot}/../Build/Client/",
            "preLaunchTask": "Build",
            "runtimeExecutable": null,
            "env": {},
            "console": "integratedTerminal"
        }

image

@ghost
Copy link

ghost commented Oct 23, 2017

And yes, in my case I am compiling my code before I run and it might also be worth noting that my code is C# not F#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants