We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Invalid Operation Exception in XPTheme class

Thread ID:





114003 Oct 22,2013 10:15 AM UTC Nov 18,2013 05:59 PM UTC WinForms 1
Tags: GridControl
Li Yong
Asked On October 22, 2013 10:15 AM UTC


My application used the SyncFusion GridControl. Occasionally I met some crashes exposed from the Grid. The callstack of the exception looks like below:

Exception type: System.InvalidOperationException
Message: Collection was modified; enumeration operation may not execute.
InnerException: <none>
StackTrace (generated):
    SP       IP       Function
    0045ED60 73767F9A mscorlib_ni!System.Collections.Hashtable+HashtableEnumerator.MoveNext()+0x72815a
    0045ED70 15DF5C44 Syncfusion_Shared_Base!Syncfusion.Windows.Forms.XPThemes.ResetThemeHandles()+0x74
    0045ED9C 15DF5BB1 Syncfusion_Shared_Base!Syncfusion.Windows.Forms.XPThemes.ApplicationExit(System.Object, System.EventArgs)+0x31
    0045EDA8 71C546DF System_Windows_Forms_ni!System.Windows.Forms.Application.RaiseExit()+0x6f
    0045EDB4 71C764D3 System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.Dispose(Boolean)+0x1b3
    0045EE1C 71C989F6 System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)+0x276
    0045EE74 71C98741 System_Windows_Forms_ni!System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)+0x61
    0045EEA4 71C55911 System_Windows_Forms_ni!System.Windows.Forms.Application.Run(System.Windows.Forms.Form)+0x31

I'm not sure whether this issue was reported before. Can you give me any clue from the above callstack?

Please do not ask me for the code snippet. Thanks.

Karuppasamy C [Syncfusion]
Replied On November 18, 2013 05:59 PM UTC

Hi Li,

Thanks for using Syncfusion Products.

We are unable to reproduce the issue at our end.

The problem is caused by a bug in the language compiler that was used to build the program.

When the invalid code runs, the JIT compiler detects the error, and then throws a System.InvalidProgramException.

In order to handle this exception, please do following steps:

1.      Provide valid code path that contains valid instructions.

2.      To determine whether your assembly contains invalid MSIL, run the PEverify tool over the program

3.      If the PEverify tool locates invalid MSIL, the language compiler that you used to build the application probably contains a bug.

If the PEverify tool does not locate invalid MSIL, the .NET Framework JIT compiler may contain a bug.

Karuppasamy C.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon