Hi, I’ve recently upgraded to v10. I have a form with a SyntaxEdit control and a DevExpress grid control (Windows forms) amongst others. Since upgrading, I receive an error message when assigning a datasource to the grid:
SystemError: The type initializer for ‘IEditableCollectionViewHelper’ threw an exception.
Inner exception: SystemError: Object reference not set to an instance of an object.
After I receive the error, I keep on getting the error when I assign data to any grid on any form.
This error only occurs if I assign text to the SyntaxEdit control. If I leave it blank, it’s fine.
I’ve discovered that this only occurs in v10 - I have rolled back to 9.5.16 and it works fine (using the same version of DevExpress controls).
Any ideas?
Could you please attach a sample project that demonstrates the issue? Does it occur in a .NET Framework or .NET Core application? I tried to reproduce the problem in a .NET Core app, but the DataSource was assigned to the DevExpress grid without any issues. Is this a design-time or run-time issue?
Thanks for your reply. I can’t get it to happen in a standalone application - there is obviously something else at play. Once I’ve pinned down the culprit I’ll post an update.
Since it only happens in the full app, try enabling first-chance exceptions for TypeInitializationException and capture the full inner stack trace; that usually shows whether the static initializer is failing in DevExpress or in the SyntaxEdit assembly. It’s also worth comparing binding redirects and referenced assembly versions for DevExpress/WindowsBase between 9.5.16 and v10. Finally, test assigning the grid DataSource before setting the SyntaxEdit text in the failing form—if that avoids the error, initialization order is likely the trigger.