Upgrade to VS2010, SP1 or copy the DLL from a good installation. What's strange though is your stackframe seems to imply you're running off version 10, which shouldn't use the enumerator? Maybe you need a VS 2010 update? Or you can also check at the Dispose implementation on the you're using.ĮDIT: after some digging, your application indeed runs on an old version of the VB Powerpacks. The latter one doesn't rely on an Enumerator object and therefore cannot fail with the error you show. NET Reflector, with, Version=9.0.0.0, it says this: foreach (Shape shape in this.m_Shapes)Īnd if I look at this method using, Version=10.0.0.0, it says this: for (int i = this.m_Shapes.Count - 1 i >= 0 i-)Ĭlearly, the implementation has evolved between versions. If I look at this method using for example.
I think it's a bug in the Dispose() method of ShapeCollection. private void imgClose_Click(object sender, EventArgs e) Rather than be handled by this dialog box.
Will be sent to the JIT debugger registered on the computer When JIT debugging is enabled, any unhandled exception The application must also be compiled with debugging config file for thisĪpplication or computer (nfig) must have the
To enable just-in-time (JIT) debugging, the. System.InvalidOperationException: Collection was modified enumeration operation may not execute.Īt (ExceptionResource resource)Īt `1.Enumerator.MoveNextRare()Īt `1.Enumerator.MoveNext()Īt .Dispose(Boolean disposing)Īt .Dispose(Boolean disposing)Īt ()Īt .Dispose(Boolean disposing)Īt .Dispose(Boolean disposing)Īt (Boolean disposing)Īt .WmClose(Message& m)Īt .WndProc(Message& m)Īt .ControlNativeWindow.OnMessage(Message& m)Īt .ControlNativeWindow.WndProc(Message& m)Īt .Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Just-in-time (JIT) debugging instead of this dialog box. See the end of this message for details on invoking If you click quit, the application will close rimmediately. If you click continue, the application will ignore this error and attempt to continue. Unhandled exception has occurred in your application. My not using tab strip nor trying to close multiple form. Net Framework 4 Client Profile as Target Framework.
I have checked the code and and there is no difference in it(this.close()). The exception is occurring in some forms not in all. Every time I try to close the form, it ends up with this exception. I later on to test the application I installed it another machine which does not have VS in it.
I tested the setup in my test PC which have Vs 2010 Ultimate installed in it and its working fine in it. I created a setup project of window form application built in C# 4.0.