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

Problems on changes from outside the UI thread: System.InvalidOperationException #6

Open
XySoftNeil opened this issue May 20, 2019 · 2 comments
Assignees

Comments

@XySoftNeil
Copy link

Not so much of an issue as a warning to others. If you have a need to load your monitored document in the background from a BackgroundWorker, you may run into a sporadic error.

"System.InvalidOperationException: 'Collection was modified; enumeration operation may not execute.'"

the cure for this is to make sure you are doing all your operations in the UI thread. Or It may be that the MUF code could be changed to make sure that all operations occur on the UI thread.

@nathanaw nathanaw self-assigned this Apr 18, 2020
@nathanaw
Copy link
Owner

I'll need to investigate if/how we might enhance the library to help prevent this.

@XySoftNeil
Copy link
Author

Hi Nathan, It might work out to do an IgnoreBatch similar to an UndoBatch. In the case of the editor I am maintaining, I would set up the ignore, do the long running operations, then end the ignore. At that point, start an undo batch, and replace the old file property for the new. If you are accepting pull requests I would be willing to work on this. Thanks for this very useful package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants