Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection was modified; enumeration operation may not execute #3

Open
valkyrienyanko opened this issue Jul 5, 2020 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@valkyrienyanko
Copy link
Contributor

Describe the Issue

Appears when you start / restart server. Seems to be related be a thread synchronization issue with the message list or foreach loop, can't tell for sure.

Unhandled exception. System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at Terminal.Gui.View.Redraw(Rect region)
   at Terminal.Gui.View.Redraw(Rect region)
   at Terminal.Gui.Toplevel.Redraw(Rect region)
   at Terminal.Gui.Application.Redraw(View view)
   at Terminal.Gui.Application.Begin(Toplevel toplevel)
   at Terminal.Gui.Application.Run(Toplevel view)
   at Terminal.Gui.Application.Run()
   at GameServer.Logging.Logger.Start() in C:\Users\valkyrienyanko\Desktop\game-server\src\GameServer\Logging\Logger.cs:line 55
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Steps to Reproduce

  1. Run the server with dotnet run
  2. Stop the server with Ctrl + C
  3. Repeat steps 1 through 2 until you see the error

Expected Behavior

None of this should be happening.

Preview

image

@valkyrienyanko valkyrienyanko added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Jul 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant