microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
216 stars 9 forks source link

[BUG] Failed to attach debugger #1230

Closed takehiro-matsuda closed 1 month ago

takehiro-matsuda commented 2 months ago

Describe the Issue

Attach to Unity fails.

Steps To Reproduce

  1. Show and Run Command > Attach Unity Debugger
  2. Failed to attach Debugger

Expected Behavior

Failed to attach Debugger
image

log by config "logFile": "${workspaceRoot}/debug.log"

debug.log

Environment Information

Visual Studio Code Version: 1.90.2 (user setup) Commit: 5437499feb04f7a586f677b155b039bc2b3669eb Date: 2024-06-18T22:34:26.404Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.19045

Extention C# Dev Kit v1.7.27 Unity Integrates Visual Studio Code with unity v1.0.2

Unity 2022.3.19f1

jbevain commented 2 months ago

Hi,

Thanks for reaching out. Could you detail your scenario? Is this happening all the time?

At this point, we have no known issue related to attaching the debugger, so the issue might be specific to either your environment or your workload.

Please check that your firewall allows connection to Unity.exe and from VSCode and its child processes. Please also make sure that Unity's debug mode is enabled.

Thanks!

junsun2h commented 1 month ago

[.vscode\launch.json] { "version": "0.2.0", "configurations": [ { "name": "Attach to Unity", "type": "vstuc", "request": "attach", //"endPoint": "127.0.0.1:56321" } ] }

I had the same issue. In my case, commenting out the "endPoint" allowed the attachment to work.

VSCode: 1.90.2 Unity: 2022.3.34f1

jbevain commented 1 month ago

No answer from OP, closing this. Feel free to re-open a new bug if you're still experiencing issues. Thanks!