ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

No default debug configuration

Open Eliemer opened this issue 1 year ago • 5 comments

Describe the bug

when starting a fresh project and going to the "debug and run" pane, there's no longer any Ionide automatic configurations in the dropdowns.

Steps to reproduce

  1. New dotnet project
  2. Open "Run and Debug" pane
  3. click "Show all automatic debug configurations"

Expected behaviour

There should be Ionide configs in that dropdown.

Screenshots

image

Machine info

  • OS: Windows
  • .NET SDK version: 8.0.204
  • Ionide version: 7.19.1

Eliemer avatar May 01 '24 01:05 Eliemer

@baronfel is this something we have to pester the C# plugin about?

TheAngryByrd avatar May 01 '24 11:05 TheAngryByrd

Ours should be under the .NET Core drop-down selection there, IIRC?

baronfel avatar May 01 '24 11:05 baronfel

When i click the .NET Core dropdown i get an empty search bar i think? image

That said, when i manually run F#: Debug default project everything works as intended.

Eliemer avatar May 02 '24 03:05 Eliemer

So it seems like the C# plugin is just ignoring all fsproj files in any of their pickers.

You'll have to click create a launch.json file

image

It'll still pop up some selection. Just choose something to get the file created. This seems like a VSCode UX problem where it won't just create the file for you.

image

You might have something in the file already configured, otherwise just clear it so it's nice and pristine:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": []
}

You can then type in the configuration array and find some .NET configurations.

image

Selecting something like console and filling in the bits for the dll path should result in something like:

{

    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "${workspaceFolder}/bin/Debug/net8.0/fsharp-playground",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "console": "internalConsole"
        }
    ]
}

It should then show up in the panel for you click on:

image

Then you should be able to debug.

image


Be sure to use the coreclr type. And of course you can't use dotnet to select an fsproj

image

https://twitter.com/dotnetiscsharp

TheAngryByrd avatar May 09 '24 01:05 TheAngryByrd

The following works for me as a manual workaround to achieve F5 debugging:

./.vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build FSDebugging.fsproj",
            "program": "${workspaceFolder}/bin/Debug/net8.0/FSDebugging.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "console": "internalConsole"
        }
    ]
}

./.vscode/tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "build FSDebugging.fsproj",
			"type": "shell",
			"command": "dotnet build ${workspaceFolder}/FSDebugging.fsproj",
			"problemMatcher": []
		}
	]
}

roboz0r avatar May 09 '24 03:05 roboz0r