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

No default debug configuration #2009

Open
Eliemer opened this issue May 1, 2024 · 5 comments
Open

No default debug configuration #2009

Eliemer opened this issue May 1, 2024 · 5 comments

Comments

@Eliemer
Copy link

Eliemer commented May 1, 2024

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
@TheAngryByrd
Copy link
Member

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

@baronfel
Copy link
Contributor

baronfel commented May 1, 2024

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

@Eliemer
Copy link
Author

Eliemer commented May 2, 2024

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.

@TheAngryByrd
Copy link
Member

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

@roboz0r
Copy link

roboz0r commented May 9, 2024

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": []
		}
	]
}

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

No branches or pull requests

4 participants