godot-csharp-visualstudio icon indicating copy to clipboard operation
godot-csharp-visualstudio copied to clipboard

Problems with "Play in Editor" randomly disconnecting from/crashing the Godot editor

Open Jakob-PB opened this issue 5 years ago • 3 comments

OS/device including version: Windows 10 Godot 3.2.3 beta1 Visual Studio 2019, Version 16.6.4 godot-csharp-visualstudio v1.1.1

Issue description: The following issues are occurring in a brand new project with a single C# file that is only doing a GD.Print("Hello").

Sometimes this plugin will disconnect from the Godot editor even though the Godot editor has remained open. It's unfortunately not very reproducible and if I try again after waiting a while sometimes "Play in Editor" will start working again. If the plugin was disconnected I get this error alert and the following console output:

play_error.png

ERROR: Another resource is loaded from path 'res://scripts/TestScript.cs' (possible cyclic resource inclusion).
   At: core/resource.cpp:82
ERROR: godot_icall_GD_pusherror: Unhandled exception in the peer loop
System.Threading.ThreadAbortException: Thread was being aborted.
  at System.IO.StreamReader.ReadBufferAsync () [0x001e0] in <34e7ab706f1141f9b981d74fbe2f5560>:0
  at System.IO.StreamReader.ReadLineAsyncInternal () [0x00093] in <34e7ab706f1141f9b981d74fbe2f5560>:0
  at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
  at GodotTools.IdeMessaging.Peer.Process () [0x0033a] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
   At: modules/mono/glue/gd_glue.cpp:250

I have also seen this error come up randomly in a similar manner, usually after I close the running game instance:

stack_trace.png

Other times the "Play in Editor" functionality of this plugin has occasionally crashed the Godot editor. It doesn't seem to be related to errors in the C# code, and again this project is so minimal that nothing I'm doing should be crashing the editor.

These crashes also aren't very reproducible, and I have found no discernible pattern as to what triggers it so far but it has happened more than once.

This is the last mono log before one of these crashes:

Config attempting to parse: 'C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/etc\mono\config'. (in domain Mono, info)
Image addref mscorlib[00000000170FD620] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll[000000001726EA80]: 2 (in domain Mono, info)
Prepared to set up assembly 'mscorlib' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll) (in domain Mono, info)
AOT: image 'C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/mscorlib.dll.dll' not found: The system cannot find the file specified.
 (in domain Mono, info)
AOT: image 'C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/aot-cache/amd64/mscorlib.dll.dll' not found: The system cannot find the path specified.
 (in domain Mono, info)
Assembly mscorlib[00000000170FD620] added to domain GodotEngine.RootDomain, ref_count=1 (in domain Mono, info)
Assembly mscorlib[00000000170FD620] added to domain GodotEngine.Domain.Scripts, ref_count=2 (in domain Mono, info)
Image addref GodotSharp[00000000170FE430] (asmctx DEFAULT) -> C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharp.dll[00000000172EB340]: 3 (in domain Mono, info)
Prepared to set up assembly 'GodotSharp' (C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharp.dll) (in domain Mono, info)
Assembly GodotSharp[00000000170FE430] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Loading reference 0 of C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharp.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Config attempting to parse: ''. (in domain Mono, info)
Assembly Ref addref GodotSharp[00000000170FE430] -> mscorlib[00000000170FD620]: 3 (in domain Mono, info)
Image addref GodotSharpEditor[00000000170FE670] (asmctx DEFAULT) -> C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharpEditor.dll[0000000017443A40]: 3 (in domain Mono, info)
Prepared to set up assembly 'GodotSharpEditor' (C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharpEditor.dll) (in domain Mono, info)
Assembly GodotSharpEditor[00000000170FE670] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Loading reference 0 of C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharpEditor.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref GodotSharpEditor[00000000170FE670] -> mscorlib[00000000170FD620]: 4 (in domain Mono, info)
Loading reference 2 of C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharp.dll asmctx DEFAULT, looking for System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Image addref System[00000000170FE700] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.dll[0000000017497010]: 2 (in domain Mono, info)
Prepared to set up assembly 'System' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.dll) (in domain Mono, info)
Assembly System[00000000170FE700] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Assembly Ref addref GodotSharp[00000000170FE430] -> System[00000000170FE700]: 2 (in domain Mono, info)
Loading reference 0 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System[00000000170FE700] -> mscorlib[00000000170FD620]: 5 (in domain Mono, info)
Loading reference 2 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.dll asmctx DEFAULT, looking for System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (in domain Mono, info)
Image addref System.Configuration[00000000174BBF10] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Configuration.dll[00000000174CD0A0]: 2 (in domain Mono, info)
Prepared to set up assembly 'System.Configuration' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Configuration.dll) (in domain Mono, info)
Assembly System.Configuration[00000000174BBF10] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Assembly Ref addref System[00000000170FE700] -> System.Configuration[00000000174BBF10]: 2 (in domain Mono, info)
Loading reference 0 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Configuration.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System.Configuration[00000000174BBF10] -> mscorlib[00000000170FD620]: 6 (in domain Mono, info)
Loading reference 2 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Configuration.dll asmctx DEFAULT, looking for System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System.Configuration[00000000174BBF10] -> System[00000000170FE700]: 3 (in domain Mono, info)
Loading reference 1 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Configuration.dll asmctx DEFAULT, looking for System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Image addref System.Xml[00000000174BDAA0] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Xml.dll[000000001756A230]: 2 (in domain Mono, info)
Prepared to set up assembly 'System.Xml' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Xml.dll) (in domain Mono, info)
Assembly System.Xml[00000000174BDAA0] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Assembly Ref addref System.Configuration[00000000174BBF10] -> System.Xml[00000000174BDAA0]: 2 (in domain Mono, info)
Loading reference 0 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Xml.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System.Xml[00000000174BDAA0] -> mscorlib[00000000170FD620]: 7 (in domain Mono, info)
DllImport attempting to load: 'BCrypt.dll'. (in domain Mono, info)
DllImport error loading library 'C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5\BCrypt.dll': 'The system cannot find the file specified.
'. (in domain Mono, info)
DllImport error loading library 'C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5\BCrypt.dll': 'The system cannot find the file specified.
'. (in domain Mono, info)
DllImport error loading library 'C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5\BCrypt.dll': 'The system cannot find the file specified.
'. (in domain Mono, info)
DllImport loaded library 'BCrypt.dll'. (in domain Mono, info)
DllImport searching in: 'BCrypt.dll' ('BCrypt.dll'). (in domain Mono, info)
Searching for 'BCryptGenRandom'. (in domain Mono, info)
Probing 'BCryptGenRandomW'. (in domain Mono, info)
Could not find 'BCryptGenRandomW' due to 'The specified procedure could not be found.
'. (in domain Mono, info)
Probing 'BCryptGenRandom'. (in domain Mono, info)
Found as 'BCryptGenRandom'. (in domain Mono, info)
DllImport attempting to load: '__Internal'. (in domain Mono, info)
DllImport loaded library '(null)'. (in domain Mono, info)
DllImport searching in: '__Internal' ('(null)'). (in domain Mono, info)
Searching for 'SetThreadErrorMode'. (in domain Mono, info)
DllImport searching in: '__Internal' ('(null)'). (in domain Mono, info)
Searching for 'GetFileAttributesExW'. (in domain Mono, info)
Probing 'GetFileAttributesExWW'. (in domain Mono, info)
Could not find 'GetFileAttributesExWW' due to 'The specified procedure could not be found.
'. (in domain Mono, info)
Probing 'GetFileAttributesExW'. (in domain Mono, info)
Found as 'GetFileAttributesExW'. (in domain Mono, info)
Loading reference 2 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Xml.dll asmctx DEFAULT, looking for System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System.Xml[00000000174BDAA0] -> System[00000000170FE700]: 4 (in domain Mono, info)
Loading reference 3 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.dll asmctx DEFAULT, looking for System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System[00000000170FE700] -> System.Xml[00000000174BDAA0]: 3 (in domain Mono, info)
Image addref GodotTools[00000000174BC390] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Tools/GodotTools.dll[00000000239697B0]: 3 (in domain Mono, info)
Prepared to set up assembly 'GodotTools' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Tools/GodotTools.dll) (in domain Mono, info)
Assembly GodotTools[00000000174BC390] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Image addref GodotTools.ProjectEditor[00000000174BC8A0] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Tools/GodotTools.ProjectEditor.dll[0000000023D20E40]: 3 (in domain Mono, info)
Prepared to set up assembly 'GodotTools.ProjectEditor' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Tools/GodotTools.ProjectEditor.dll) (in domain Mono, info)
Assembly GodotTools.ProjectEditor[00000000174BC8A0] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Image addref VehiclePort[00000000174BD350] (asmctx DEFAULT) -> C:/dev/Godot/VehiclePort/.mono/temp/bin/Debug/VehiclePort.dll[0000000023A760E0]: 3 (in domain Mono, info)
Prepared to set up assembly 'VehiclePort' (C:/dev/Godot/VehiclePort/.mono/temp/bin/Debug/VehiclePort.dll) (in domain Mono, info)
Assembly VehiclePort[00000000174BD350] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Loading reference 1 of C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharp.dll asmctx DEFAULT, looking for System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Image addref System.Core[00000000174BFBD0] (asmctx DEFAULT) -> C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Core.dll[0000000023CA07B0]: 2 (in domain Mono, info)
Prepared to set up assembly 'System.Core' (C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Core.dll) (in domain Mono, info)
Assembly System.Core[00000000174BFBD0] added to domain GodotEngine.Domain.Scripts, ref_count=1 (in domain Mono, info)
Assembly Ref addref GodotSharp[00000000170FE430] -> System.Core[00000000174BFBD0]: 2 (in domain Mono, info)
Loading reference 0 of C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Core.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 (in domain Mono, info)
Assembly Ref addref System.Core[00000000174BFBD0] -> mscorlib[00000000170FD620]: 8 (in domain Mono, info)
GC_MAJOR: (user request) time 0.68ms, stw 0.81ms los size: 1024K in use: 64K (in domain Mono, info)
GC_MAJOR_SWEEP: major size: 1040K in use: 187K (in domain Mono, info)
GC_MAJOR: (user request) time 0.28ms, stw 0.32ms los size: 1024K in use: 64K (in domain Mono, info)
GC_MAJOR_SWEEP: major size: 1056K in use: 187K (in domain Mono, info)
GC_MAJOR: (user request) time 0.28ms, stw 0.40ms los size: 1024K in use: 64K (in domain Mono, info)
GC_MAJOR_SWEEP: major size: 1056K in use: 188K (in domain Mono, info)
GC_MINOR: (user request) time 0.12ms, stw 0.22ms promoted 0K major size: 1056K in use: 188K los size: 1024K in use: 64K (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly mscorlib[00000000170FD620], ref_count=8 (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly GodotSharp[00000000170FE430], ref_count=1 (in domain Mono, info)
Unloading assembly GodotSharp [00000000170FE430]. (in domain Mono, info)
Unloading image data-0000000017334010 [0000000017400730]. (in domain Mono, info)
Unloading image C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharp.dll [00000000172EB340]. (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly GodotSharpEditor[00000000170FE670], ref_count=1 (in domain Mono, info)
Unloading assembly GodotSharpEditor [00000000170FE670]. (in domain Mono, info)
Unloading image data-000000001744C7C0 [0000000017451BC0]. (in domain Mono, info)
Unloading image C:/dev/Godot/VehiclePort/.mono/assemblies/Debug/GodotSharpEditor.dll [0000000017443A40]. (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly System[00000000170FE700], ref_count=3 (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly System.Configuration[00000000174BBF10], ref_count=2 (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly System.Xml[00000000174BDAA0], ref_count=3 (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly GodotTools[00000000174BC390], ref_count=1 (in domain Mono, info)
Unloading assembly GodotTools [00000000174BC390]. (in domain Mono, info)
Unloading image data-0000000023BB9280 [0000000023D3FA30]. (in domain Mono, info)
Unloading image C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Tools/GodotTools.dll [00000000239697B0]. (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly GodotTools.ProjectEditor[00000000174BC8A0], ref_count=1 (in domain Mono, info)
Unloading assembly GodotTools.ProjectEditor [00000000174BC8A0]. (in domain Mono, info)
Unloading image data-0000000023BCCB70 [0000000023D21570]. (in domain Mono, info)
Unloading image C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Tools/GodotTools.ProjectEditor.dll [0000000023D20E40]. (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly VehiclePort[00000000174BD350], ref_count=1 (in domain Mono, info)
Unloading assembly VehiclePort [00000000174BD350]. (in domain Mono, info)
Unloading image data-0000000023968660 [0000000023A76810]. (in domain Mono, info)
Unloading image C:/dev/Godot/VehiclePort/.mono/temp/bin/Debug/VehiclePort.dll [0000000023A760E0]. (in domain Mono, info)
Unloading domain GodotEngine.Domain.Scripts[00000000172900B0], assembly System.Core[00000000174BFBD0], ref_count=1 (in domain Mono, info)
Unloading assembly System.Core [00000000174BFBD0]. (in domain Mono, info)
Unloading image C:\dev\Godot\_GODOT\Godot_v3.2.3-beta1_mono_win64/GodotSharp/Mono/lib/mono/4.5/System.Core.dll [0000000023CA07B0]. (in domain Mono, info)
GC_MAJOR: (user request) time 0.19ms, stw 0.32ms los size: 0K in use: 0K (in domain Mono, info)
GC_MAJOR_SWEEP: major size: 240K in use: 2K (in domain Mono, info)

Jakob-PB avatar Jul 21 '20 04:07 Jakob-PB

After some further testing it seems that these problems might have something to do with moving C# scripts around. If I open up the project, move a C# file to another folder, press "Reload All" when prompted, and then press "Play in Editor" it will usually (but not 100% reproducibly) either crash the Godot editor or show the "No Godot editor instance connected" error alert popup. If it doesn't crash but only gives the "No Godot editor instance connected" popup then "Play in Editor" will usually start working again after a second try.

Also here's another error that I received in the console during one of the connection failures:

ERROR: godot_icall_GD_pusherror: Unhandled exception in the peer loop
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.
  at System.Net.Sockets.NetworkStream.EndRead (System.IAsyncResult asyncResult) [0x00015] in <1b258c66af934287ab0304649d81ba79>:0
  at System.IO.Stream+<>c.<BeginEndReadAsync>b__45_1 (System.IO.Stream stream, System.IAsyncResult asyncResult) [0x00000] in <34e7ab706f1141f9b981d74fbe2f5560>:0
  at System.Threading.Tasks.TaskFactory`1+FromAsyncTrimPromise`1[TResult,TInstance].Complete (TInstance thisRef, System.Func`3[T1,T2,TResult] endMethod, System.IAsyncResult asyncResult, System.Boolean requiresSynchronization) [0x00000] in <34e7ab706f1141f9b981d74fbe2f5560>:0
--- End of stack trace from previous location where exception was thrown ---

  at System.IO.StreamReader.ReadBufferAsync () [0x001e0] in <34e7ab706f1141f9b981d74fbe2f5560>:0
  at System.IO.StreamReader.ReadLineAsyncInternal () [0x00093] in <34e7ab706f1141f9b981d74fbe2f5560>:0
  at GodotTools.IdeMessaging.Peer.ReadLine () [0x000b0] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
  at GodotTools.IdeMessaging.Peer.Process () [0x0033a] in <22b1cc7a6c9542d4958cd3d1d92a6515>:0
   At: modules/mono/glue/gd_glue.cpp:250

Jakob-PB avatar Jul 21 '20 04:07 Jakob-PB

Anyone has figured out how to address this? @neikeq This is the MOST common problem

GeorgeS2019 avatar Jan 25 '22 22:01 GeorgeS2019

I solved this by adding two delays inside OnRun in the file Debugging\GodotDebuggerSession.cs

I think a single 400 ms delay (in the first instruction, removing the second one) would also work. If I only have 200 ms delay the problem still happens but with two it goes away. Note that the 'glitch' that occurs when you do not delay can throw the editor into a funny state as far as debugging connections are concerned. So, after recompiling and reinstalling the vsix, you have to restart the editor. I think PC speed will matter but for me, the following totally eliminates the problem. So far I do not get the "no instance connected" issue and also I don't get godot editor shutdowns (though I only tested 10 minutes).

The problem seems to be on VS side. Godot responds to the connection each time normally and fast, but the glitch happens when the VS side says we're not connected when godot thinks we are.

StartListening(godotStartInfo, out var assignedDebugPort); Thread.Sleep(200); var godotMessagingClient = GodotPackage.Instance.GodotSolutionEventsListener?.GodotMessagingClient; Thread.Sleep(200); if (godotMessagingClient == null)

kwas-123 avatar Jan 07 '24 12:01 kwas-123