Comments (3)
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
from godot-csharp-visualstudio.
Anyone has figured out how to address this? @neikeq This is the MOST common problem
from godot-csharp-visualstudio.
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)
from godot-csharp-visualstudio.
Related Issues (20)
- Exception with Xamarin.VisualStudio "file already exists" HOT 5
- IntelliSense stops working with the debugging workaround HOT 5
- Can not launch game from Visual Studio 2022 HOT 12
- Cannot install it for visual studio 2022 HOT 2
- Cannot break in referenced projects.
- Extension stopped working on VisualStudio v17.3.0 HOT 10
- How to improve VisualStudio experience with Godot4 NativeAOT? HOT 4
- Latest Update from the submitted PRs HOT 33
- Where is the official "how to install" documentation? HOT 1
- Is this Obsolete? VS2022 works with Godot 4.Beta1 no extension needed HOT 8
- Make the launching easier HOT 1
- New launch workaround HOT 3
- Implement Input map suggestion
- adding PathMap to csproj breaks debugger
- [WIP] Godot4 Visual Studio 2022 Guide HOT 7
- [WIP] Re-design Godot 4 VS2022 Extension HOT 4
- [WIP] Hot Reload
- Support for Profiling? HOT 2
- Game changing framework for Godot 4 Visual Studio: VS2022 compatible test adaptor framework HOT 13
- Godot 4 addon for supporting debug in VS2022
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot-csharp-visualstudio.