godot-csharp-vscode
godot-csharp-vscode copied to clipboard
Debugging hangs and does nothing
Can't debug at all on KDE Neon anymore. This was working fine yesterday but nothing today. This hasn't been working on my laptop for a few weeks as well (same OS). If I run "Play in Editor" VScode enters debug mode but nothing happens. I'm sorry that I can't tell you more. Where can I find extension logs to find out what is going on here and provide some more valuable feedback
Update: I have received the following error message when debugging with the "Launch (select scene)" config
ERROR: Handshake failed with unhandled exception:
System.ObjectDisposedException: Cannot read from a closed TextReader.
at System.IO.StreamReader.ReadLineAsync () [0x00026] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.IdeMessaging.Peer.DoHandshake (System.String identity) [0x001a3] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.Ides.MessagingServer.AcceptClient (System.Net.Sockets.TcpClient tcpClient) [0x00124] in <32b0807a97a14cd4a5b3103688cd335f>:0
at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)
ERROR: Handshake failed with unhandled exception:
System.ObjectDisposedException: Cannot read from a closed TextReader.
at System.IO.StreamReader.ReadLineAsync () [0x00026] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.IdeMessaging.Peer.DoHandshake (System.String identity) [0x001a3] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.Ides.MessagingServer.AcceptClient (System.Net.Sockets.TcpClient tcpClient) [0x00124] in <32b0807a97a14cd4a5b3103688cd335f>:0
at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)
ERROR: Handshake failed with unhandled exception:
System.ObjectDisposedException: Cannot read from a closed TextReader.
at System.IO.StreamReader.ReadLineAsync () [0x00026] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.IdeMessaging.Peer.DoHandshake (System.String identity) [0x001a3] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.Ides.MessagingServer.AcceptClient (System.Net.Sockets.TcpClient tcpClient) [0x00124] in <32b0807a97a14cd4a5b3103688cd335f>:0
at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)
ERROR: Handshake failed with unhandled exception:
System.ObjectDisposedException: Cannot read from a closed TextReader.
at System.IO.StreamReader.ReadLineAsync () [0x00026] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.IdeMessaging.Peer.DoHandshake (System.String identity) [0x001a3] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.Ides.MessagingServer.AcceptClient (System.Net.Sockets.TcpClient tcpClient) [0x00124] in <32b0807a97a14cd4a5b3103688cd335f>:0
at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)
ERROR: Handshake failed with unhandled exception:
System.ObjectDisposedException: Cannot read from a closed TextReader.
at System.IO.StreamReader.ReadLineAsync () [0x00026] in <6a7c203f6f7a4f07b7fa766077730d49>:0
at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.IdeMessaging.Peer.DoHandshake (System.String identity) [0x001a3] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
at GodotTools.Ides.MessagingServer.AcceptClient (System.Net.Sockets.TcpClient tcpClient) [0x00124] in <32b0807a97a14cd4a5b3103688cd335f>:0
at: godot_icall_GD_pusherror (modules/mono/glue/gd_glue.cpp:249)
I'll assume you are using Godot 3.x because 4.0 is not released yet and therefore not supported but if you can provide the exact version that'd be great.
About the Play in Editor option, you can take a look at the logs that are stored in ~/.vscode/extensions/neikeq.godot-csharp-vscode-0.2.1/dist/GodotDebugSession/GodotDebugSession.log. The most likely reason is it can't connect to the Godot editor, remember that the Play in Editor option requires that the Godot editor is open.
About the Launch option, it works a bit differently to Play in Editor so the issue might be unrelated. In this case the Godot editor is launched by VSCode in the same way you can launch it from the terminal with some CLI arguments for debugging. It seems the server can't read from the client because it is closed during handshake, not sure why. Try adding --verbose to the executableArguments in launch.json for the Launch option and take a look at the output in the Debug Console tab in VSCode, it may provide more information.
Sorry about leaving out the version, I was using 3.4.2 and now 3.4.3 but I still have the same issue. I also have the editor running every time I try debugging if that helps.
Ahh, that's where the logs are! Good tip. With that I get:
11:29:17.603003: GodotDebugSession: Starting debug session...
11:29:17.633926: System.TypeLoadException: Could not load type of field 'Mono.Debugging.Client.BreakpointStore:breakpoints' (4) due to: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
at GodotDebugSession.GodotDebugSession..ctor () [0x0000b] in <0a3b00c378f04a33aefb579dd0382ae6>:0
at GodotDebugSession.Program.Main () [0x0000a] in <0a3b00c378f04a33aefb579dd0382ae6>:0
Using dotnet --list-sdks I get 3.1.416, which is the same as what I get on my desktop which works fine now for some strange reason. I viewed the logs on my desktop and it looks perfectly fine and shows that connections are being made just fine. Just for completeness, both computers are using vscode 1.65.0, KDE Neon 5.24.2 and Godot Mono 3.4.3. The only difference I could find is that my laptop uses Mono 6.8.0.105 and my desktop uses Mono 6.12.0.122.
A more full log is below:
01:16:00.624926: GodotDebugSession: Starting debug session...
01:16:01.129308: Connecting to Godot Ide Server
01:16:01.133369: Connection open with Godot Ide Server
01:16:01.134070: Accept client...
01:16:01.167412: Connection open with Ide Client
01:16:01.174164: Peer connection started
01:16:01.174603: Sending message: Request | DebugPlay
01:16:01.377304: Received message: DebugPlay
01:16:07.357662: GodotDebugSession: Debug session terminated.
11:29:17.603003: GodotDebugSession: Starting debug session...
11:29:17.633926: System.TypeLoadException: Could not load type of field 'Mono.Debugging.Client.BreakpointStore:breakpoints' (4) due to: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
at GodotDebugSession.GodotDebugSession..ctor () [0x0000b] in <0a3b00c378f04a33aefb579dd0382ae6>:0
at GodotDebugSession.Program.Main () [0x0000a] in <0a3b00c378f04a33aefb579dd0382ae6>:0
...
This just repeats for a long time
Update: With mono updated to the same version it now works fine. Is the extension needing something from Mono that it shouldn't? It seems as though the requirements for this extension isn't just Godot. This should be narrowed down and documented