1

フォームから線の形状を削除して、この問題を修正しました。

元の投稿

フォームを閉じると、次のエラーが表示されます。

System.InvalidOperationException: コレクションが変更されました。列挙操作が実行されない可能性があります

これは、プログラムがデバッグ中以外のマシンにデプロイされた場合にのみ表示されます。フォームを非表示にすると、フォームが閉じられたときにのみ発生しません。

これは今本当に面倒になっているので、どんな助けも大歓迎です。前もって感謝します、
クレイグ

ps 以下は FormClosed イベントです

    'Disconnect from database
    cn.Close()
    cn.Dispose()

スタックトレース

   ************** Exception Text **************
   System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at Microsoft.VisualBasic.PowerPacks.ShapeCollection.Dispose(Boolean disposing)
   at Microsoft.VisualBasic.PowerPacks.ShapeContainer.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.Windows.Forms.TabControl.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.Windows.Forms.Form.Dispose(Boolean disposing)
   at EquiManager.frmEditJumpingShow.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at System.Windows.Forms.Form.WmClose(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
4

1 に答える 1

0

線の形状を削除すると、エラーが消えました。

于 2013-07-22T19:39:47.983 に答える