dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.85k stars 668 forks source link

[BUG] Launch adds hyphen and breaks path #7504

Open WardenGnaw opened 2 weeks ago

WardenGnaw commented 2 weeks ago

Originally from https://github.com/microsoft/vscode-dotnettools/issues/1425 by @georg-eckert-zeiss

Describe the Issue

When adding a configuration and trying to run it a hyphen ("-") is added to the executable. Therefore I get an error that the file cannot be found.

image

Steps To Reproduce

  1. in ubuntu linux clone a C# project like nuget-inspector
  2. install the C# dev kit extension in vs code
  3. create a launch.json
  4. add a new configuration ".NET: launch executable file (Console)"
  5. launch it

Expected Behavior

file is launched

instead a hyphen is added and changes the path from

/bin/Debug/net6.0/linux-x64/nuget-inspector.dll to /bin/Debug/net6.0/linux-x64/-nuget-inspector.dll

Environment Information

WardenGnaw commented 1 week ago

@georg-eckert-zeiss does the binary exist at /home/georg/app/niz/src/bin/Debug/net6.0/linux-x64/nuget-inspector.dll?

I was unable to reproduce the issue with: OS: Ubuntu 22.04 VS Code: 1.92.2 C# Extension: v2.39.29 C# Dev Kit: v1.9.55

The launch.json that worked for me was:

        {
            "name": ".NET Core Launch (console)",
            "type": "coreclr",
            "request": "launch",
            "program": "${workspaceFolder}/src/nuget-inspector/bin/Debug/net6.0/linux-x64/nuget-inspector.dll",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": false,
            "console": "internalConsole"
        }