question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.InvalidOperationException has been thrown

See original GitHub issue

Hi,

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.

Screenshot 2019-12-15 at 17 08 08

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
christophedelanghecommented, Mar 27, 2020

What is the status here? I have the same problem … is there a workaround?

0reactions
uptacommented, Mar 30, 2020

Merged in #31 and published to Nuget as 4.0.1

Thanks guys!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found