Closed Junjun-zhao closed 6 months ago
We can repro this issue in .Net 9.0(form designer cannot be loaded successfully), not .Net 8.0, here is the call stack --- it seems to be a DevExpress product issue.
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'FormIconHelper' threw an exception.
Source=DevExpress.Utils.v23.2
StackTrace:
at DevExpress.XtraEditors.FormIconOptions.FormIconHelper..ctor(Form form)
at DevExpress.XtraEditors.FormIconOptions.Initialize()
at DevExpress.XtraEditors.FormIconOptions..ctor(IFormIconOptionsOwner owner, Boolean initIconImmediately)
at DevExpress.XtraEditors.FormIconOptions..ctor(IFormIconOptionsOwner owner)
at DevExpress.XtraEditors.XtraForm.CreateIconOptions()
at DevExpress.XtraEditors.XtraForm..ctor()
at DevExpress.XtraBars.Ribbon.RibbonForm..ctor()
at WinFormsApp11.Form1..ctor() in C:\Users\xxx\source\repos\WinFormsApp11\WinFormsApp11\Form1.cs:line 6
at WinFormsApp11.Program.Main() in C:\Users\xxx\source\repos\WinFormsApp11\WinFormsApp11\Program.cs:line 14
Inner Exception 1:
NullReferenceException: Object reference not set to an instance of an object.
Unfortunately, this looks to be an issue with private reflection on internal types, and we can't promise that this internal surface doesn't change.
@merriemcgaw @JeremyKuhne Thank you for helping investigate this issue. Any updates regarding it? Could you please let us know if this issue is a blocker for .NET 9 Preview 4?
@Junjun-zhao was Devexpress 24.1 tested? I've raised a Devexpress support issue at: https://supportcenter.devexpress.com/ticket/details/t1231900/exception-in-formiconhelper-net9-preview
@Junjun-zhao was Devexpress 24.1 tested? I've raised a Devexpress support issue at: https://supportcenter.devexpress.com/ticket/details/t1231900/exception-in-formiconhelper-net9-preview
Thank you for sharing the link . So this is also Devexpress issue , right ? No. We tried to download the latest trial version from the official site , the version is still V23.2 .
@Junjun-zhao apparently it has been fixed in v23.2.6
Thank you very much @elachlan Verified this issue with the latest build 9.0.100-preview.4.24257.5, it has been fixed with Devexpress v23.2.6 . Hence closing it.
.NET version
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes
Verify Scenarios:
Issue description
When we run Analogy.exe with dotnet-sdk-9.0.100-preview.4.24223.3, it will pop up window with error:
System.TypeInitializationException: 'The type initializer for 'FormIconHelper' threw an exception.'.
Application Name: Analogy.LogViewer OS: Windows 10 21H2 CPU: X64 .NET Build Number: dotnet-sdk-9.0.100-preview.4.24223.3 App Source Location, demo checking at https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2045273
Github Link: https://github.com/Analogy-LogViewer/Analogy.LogViewer
Steps to reproduce
Minimal Repro steps (Demo attached WinFormDemo.zip) The machine has dotnet-sdk-9.0.100-preview.4.24223.3 installed.
Expected Result: Run successfully. Actual Result: Show error:
System.TypeInitializationException: 'The type initializer for 'FormIconHelper' threw an exception.'
Finding: There is an app issue (DevExpress version23.1) we filed before for .NET 9 Preview1 and Preview2: [[dotnet-sdk-9.0.100-alpha.1.24070.3] AnalogyLogViewer launch failed with error: "System.AccessViolationException: Attempted to read or write protected memory..." · Issue #10719 · dotnet/winforms (github.com)](https://github.com/dotnet/winforms/issues/10719) And even we upgrade DevExpress to version 23.2 (latest version), this issue still exists in .NET 9 Preview 1 and Preview 2. But start from .NET 9 Preview 3, previous error was gone, and we get 'The type initializer for 'FormIconHelper' threw an exception.' exception now.
@dotnet-actwx-bot @dotnet/compat