godotengine / godot-csharp-vscode

Debugger and utilities for working with Godot C# projects in VSCode
https://marketplace.visualstudio.com/items?itemName=neikeq.godot-csharp-vscode
MIT License
145 stars 27 forks source link

Can't debug at all #34

Closed TimCoraxAudio closed 2 years ago

TimCoraxAudio commented 2 years ago

First time using the extension and can't get it to work at all after a couple of hours of trying.

Godot runs a basic project with no problem but the extension can't. I have dotnet CLI installed and not mono, though I had mono installed and uninstalled it, nothing changed. I have set the launch.json with the executable path such that if I copy the path string into a shell, Godot runs. Godot has been set to use Visual Studio Code as its external editor under Mono/Editor and builds with dotnet CLI under Mono/Builds

If I try to debug the project using the Launch configuration, a brief window that has no size apart from the top windows bar with minimize, maximize and exit appear. After a few seconds, the window disappears and then nothing else happens, the debugger session doesn't exit but it's not attached to anything. If I try the Play in Editor configuration nothing happens at all

Running on: VS Code 1.62 Godot 3.4 dotnet 5.0.403 Windows 10 Nvidia GTX 1070

raulsntos commented 2 years ago

I'm going to assume you are using the latest version of the extension (0.2.0).

The launch.json that is generated, automatically adds a build task to the Launch configuration which opens Godot to build the project (this may be the window you are referring to?).

The Play In Editor configuration requires the Godot editor to be open.

If you haven't used the latest version of the extension to generate the launch.json, could you share that file?


Also, the README.md was recently updated, see if the instructions there are of any help.

TimCoraxAudio commented 2 years ago
raulsntos commented 2 years ago

The launch.json seems fine.

When starting a debugging session, a bottom dock should appear in VSCode. The TERMINAL tab should show the output for the build task, is there any error reported there? The DEBUG CONSOLE tab shows the output of the debugging session, is there any output there?

mark-rafter commented 2 years ago

I'm having the same issue. I've rolled back to 0.1.3 and debugging works again

eumario commented 2 years ago

I have run into the same problem, and have found this in the log for the GodotDebugSession.log:

05:28:43.261628: GodotDebugSession: Starting debug session...
05:28:43.588631: System.NotSupportedException: The given path's format is not supported.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
   at System.IO.Directory.CreateDirectory(String path)
   at GodotTools.IdeMessaging.Client..ctor(String identity, String godotProjectDir, IMessageHandler messageHandler, ILogger logger)
   at GodotDebugSession.GodotDebuggerSession.<OnRun>d__3.MoveNext() in /home/ignacio/Projects/vscode/godot-csharp-vscode/GodotDebugSession/GodotDebuggerSession.cs:line 48

I have my project at E:\Projects\Godot\godot-manager-mono. I have also tried moving it to E:\godot-manager-mono, renaming the folder E:\GodotManagerMono, and even moving it to the C drive as well, C:\GodotManagerMono, and all cases, the same error occurs as above, it's throwing a NotSupportedException.

raulsntos commented 2 years ago

Since you are all using Windows, it seems this issue may be caused by PR #28. That PR implements support for multiple projects in the workspace, to do that it changes the way the project path is retrieved and it seems the path is now using forward slashes (the Unix path separator) and it seems that doesn't work in Windows since it uses a different path separator.

Both the author of that PR and myself use Linux so we missed this, since I don't have a Windows computer I can't test if this is the right fix, but I have opened a PR that may fix this issue: #35.

eumario commented 2 years ago

As mentioned on the PR #35, I can confirm that this patch does correct the issue, and allow projects to once more be launched from VSCode in playInEditor mode with Godot.

TimCoraxAudio commented 2 years ago

That's fantastic that we managed to work it out so quickly. When might we get this hotfix released?

neikeq commented 2 years ago

Version 0.2.1 was just published with the fix.