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

v1.8 breaks debugging of stand-alone executables on Windows if 'programName' is missing '.exe' #1335

Closed
iSazonov opened this issue Mar 20, 2017 · 13 comments
Assignees
Milestone

Comments

@iSazonov
Copy link

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-1-003177)

Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576

Runtime Environment:
OS Name: Windows
OS Version: 10.0.10240
OS Platform: Windows
RID: win10-x64

VS Code version: 1.10.2
C# Extension version: 1.8.0

Steps to reproduce

After update on VS Code version: 1.10.2 and C# Extension version: 1.8.0 debugging no longer working on Windows (below config ".NET Core Launch"). After revert to C# Extension version: 1.7.0 debugging work well again.

Expected behavior

VS Code launch debugger.

Actual behavior

Vs Code show error: "The system cannot find the file specified" on launch debugger step.

Console output:

-> (C) {"command":"initialize","arguments":{"clientID":"vscode","adapterID":"coreclr","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true},"type":"request","seq":1}
-> (C) {"command":"launch","arguments":{"logging":{"engineLogging":false,"consoleLogging":true,"trace":true,"traceResponse":true},"name":".NET Core Launch","type":"coreclr","request":"launch","justMyCode":false,"stopAtEntry":true,"program":"c:\\Users\\sie\\Documents\\GitHub\\iSazonov\\PowerShell/debug/powershell","preLaunchTask":"build","externalConsole":true,"cwd":"c:\\Users\\sie\\Documents\\GitHub\\iSazonov\\PowerShell"},"type":"request","seq":2}
<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"console","output":"-------------------------------------------------------------------\nYou may only use the Microsoft .NET Core Debugger (vsdbg) with\nVisual Studio Code, Visual Studio or Visual Studio for Mac software\nto help you develop and test your applications.\n-------------------------------------------------------------------\n"}}
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
<- (E) {"seq":4,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/LaunchFailed","data":{"VS.Diagnostics.Debugger.vsdbg.ErrorCode":1002,"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.Version":"15.1.10310.6 commit:a43f72424a3fabcd92ca8ad10ef6fc26c80c59ec"}}}
<- (R) {"seq":5,"type":"response","request_seq":2,"success":false,"command":"launch","message":"The system cannot find the file specified."}
-> (C) {"command":"disconnect","arguments":{"restart":false},"type":"request","seq":4}
<- (E) {"seq":6,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.AdapterId":"coreclr","VS.Diagnostics.Debugger.vsdbg.Version":"15.1.10310.6 commit:a43f72424a3fabcd92ca8ad10ef6fc26c80c59ec"}}}
<- (R) {"seq":7,"type":"response","request_seq":4,"success":true,"command":"disconnect"}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "logging" : {
                "engineLogging" : true,
                "trace": true,
                "traceResponse" : true
            }
            "name": ".NET Core Launch",
            "type": "coreclr",
            "request": "launch",
            "justMyCode": false,
            "stopAtEntry": true,
            "program": "${workspaceRoot}/debug/powershell",
            "preLaunchTask": "build",
            "externalConsole": true,
            "cwd": "${workspaceRoot}"
        },
        {
            "name": ".NET Core Attach",
            "type": "coreclr",
            "request": "attach",
            "justMyCode": false,
            "processName": "powershell"
        }
    ]
}
@gregg-miskelly
Copy link
Contributor

gregg-miskelly commented Mar 20, 2017

@iSazonov I think I see the problem. I am assuming powershell is powershell.exe. Is that correct? If so, can you try adding the .exe suffix to powershell in the program property and see if it works?

@iSazonov
Copy link
Author

@gregg-miskelly Thanks! I tested this without success. ProcMon trace show that Vs Code is trying to search powershell and powershell.exe too.

@gregg-miskelly
Copy link
Contributor

@iSazonov is your project something that I can clone? Does the file ${workspaceRoot}/debug/powershell.exe exist? I can tell you with pretty strong certainty that the issue is that the C# extension is getting ERROR_FILE_NOT_FOUND when we test that path.

@iSazonov
Copy link
Author

@gregg-miskelly
Copy link
Contributor

@iSazonov I think you must have run into the VSCode bug where if you make a launch.json change and immediately hit F5 it may not take effect, because when I added the .exe suffix it worked fine for me. Anyway, we will fix the .exe issue for the next release.

@gregg-miskelly gregg-miskelly changed the title Debugging no longer working on Windows v1.8 breaks debugging of stand-alone executables on Windows if 'programName' is missing '.exe' Mar 21, 2017
@gregg-miskelly gregg-miskelly added this to the 1.9 milestone Mar 21, 2017
@gregg-miskelly gregg-miskelly self-assigned this Mar 21, 2017
@iSazonov
Copy link
Author

@gregg-miskelly Many thanks!

  • I change the launch.json (add ".exe")
  • Restart VS Code
  • After F5 the debugger start and attach well.

So I see two Issue:

  1. vsdbg-ui.exe make two search powershell - first is success, second is fail (it is from ProcMon trace) This worked with clrdbg in previous version.
  2. VS Code don't apply changes in launch.json "on the fly"

@gregg-miskelly
Copy link
Contributor

@iSazonov Your 'launch.json change didn't apply' bug may be microsoft/vscode#22535. At least I haven't noticed the issue anymore after upgrading to an insiders build with the fix.

@iSazonov
Copy link
Author

@gregg-miskelly Clear. Thanks. Waiting 1.11

Should I still do something on the question about vsdbg-ui.exe ?

@gregg-miskelly
Copy link
Contributor

That is what this bug tracks.

@gregg-miskelly
Copy link
Contributor

This will be fixed in 1.9.

@iSazonov
Copy link
Author

@gregg-miskelly Many thanks!

@gregg-miskelly
Copy link
Contributor

I have posted a new release of the C# extension that includes the fix.

To try it -- use the use the Installing Beta Releases instructions to install v1.9.0-beta2.

@iSazonov
Copy link
Author

Confirm - in the beta the debugger is attached well. Thanks!

@gregg-miskelly gregg-miskelly modified the milestones: 1.8.1, 1.9 Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants