System.InvalidOperationException has been thrown
See original GitHub issueHi,
I successfully upgraded from PubSub 3.1.0 to 4.0.0, but this week I un-installed the app and re-installed from scratch. During startup I received
System.InvalidOperationException has been thrown
Collection was modified; enumeration operation may not execute
Oddly it seemed to crash every time thereafter.
I tried putting in lock mutex’s around all of my hub.Subscribe and hub.Publish invocations to ensure no threading issues from my end, but the problem continued.
In the end I had to revert back to PubSub 3.1.0 and then the problem went away.
Unfortunately I don’t have the call stack any more, but it was deep inside PubSub with a LINQ .Where clause.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why is this code throwing an InvalidOperationException?
As you can see here, the First method throws an InvalidOperationException when the sequence on which it is called is empty.
Read more >C# Exception Guide: InvalidOperationException
The InvalidOperationException exception type is thrown when a method call is invalid for the object's current state.
Read more >Type: System.InvalidOperationException
InvalidOperationException is used in cases when the failure to invoke a method is caused by reasons other than invalid arguments. For example, ...
Read more >Throwing ArgumentException and InvalidOperationException
An exception is thrown when an error is encountered in a running application, whether from bad code or bad user input.
Read more >"Exception has been thrown by the target of an invocation ...
"Exception has been thrown by the target of an invocation" error while testing SMTP settings in the backend.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What is the status here? I have the same problem … is there a workaround?
Merged in #31 and published to Nuget as 4.0.1
Thanks guys!