Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# : "A first chance exception of type 'System.InvalidOperationException'"

Tags:

c#

crash

If you check Thrown for Common Language Runtime Exception in the break when an exception window (Ctrl+Alt+E in Visual Studio), then the execution should break while you are debugging when the exception is thrown.

This will probably give you some insight into what is going on.

Example of the exceptions window


The problem here is that your timer starts a thread and when it runs the callback function, the callback function ( updatelistview) is accessing controls on UI thread so this can not be done becuase of this