Description
When run Autodesk Inventor 2025 against with .NET 9/10/11 runtime, we found it failed with an error "The type initializer for 'DevExpress.XtraEditors. OpenFormsGuard' threw an exception", which starts from dotnet-sdk-9.0.314.
Reproduction Steps
Repro steps: (Please refer to repro machine in DevDiv )
- Launch Inventor 2025 from “%ProgramFiles%\Autodesk\Inventor 2025\Bin\Inventor.exe”
- Press Ctrl+O.
- Input "C:\Users\Test01\Desktop\Bushing 1.ipt" in File name.
- Click “Open” button.
- Click “OK” button.
- Click “Manage” tab.
- Click “Parameters”.
Expected behavior
“Add Numeric” button appears.
Actual behavior
It fails with an exception"The type initializer for 'DevExpress.XtraEditors. OpenFormsGuard' threw an exception".
************** Exception Text **************
System.TypeInitializationException: The type initializer for 'DevExpress.XtraEditors.OpenFormsGuard' threw an exception.
---> System.ArgumentNullException: Value cannot be null. (Parameter 'field')
at System.ArgumentNullException.Throw(String paramName)
at System.Reflection.Emit.DynamicILGenerator.Emit(OpCode opcode, FieldInfo field)
at DevExpress.Utils.Helpers.NativeField`1.EmitStaticFieldAccessor[RETVAL](FieldInfo f_nativeField, DynamicMethod accessor, String fallbackProperty)
at DevExpress.XtraEditors.OpenFormsGuard.EmitSyncRootAccessor()
at DevExpress.XtraEditors.OpenFormsGuard..cctor()
at System.Runtime.CompilerServices.InitHelpers.CallClassConstructor(Void* cctor, Void* instantiatingArg, Exception* pException)
--- End of inner exception stack trace ---
at DevExpress.XtraEditors.OpenFormsGuard.AllForms()
at DevExpress.Utils.Drawing.GraphicsInfo.GetOpenedFormHandle()
at DevExpress.Utils.Drawing.GraphicsInfo.CanCreateCorrectGraphics(IntPtr& openFormHandle)
at DevExpress.Utils.Drawing.GraphicsInfo.get_SharedGraphics()
at DevExpress.Utils.Drawing.GraphicsInfo.GetSafeGraphics(Control defaultControl, Boolean trackControl)
at DevExpress.Utils.Drawing.GraphicsInfo.EnsureCache(Graphics g, Control defaultControl, ScaleHelper scaleDPI)
at DevExpress.Utils.Drawing.GraphicsInfo.AddGraphics(Graphics g, Control defaultControl, ScaleHelper scaleDPI)
at DevExpress.Utils.Drawing.GraphicsInfo.AddGraphics(Graphics g, ScaleHelper scaleDPI)
at DevExpress.XtraTreeList.ViewInfo.TreeListViewInfo.CalcViewInfo()
at DevExpress.XtraTreeList.TreeList.UpdateLayout()
at DevExpress.XtraTreeList.TreeList.LayoutChanged()
at DevExpress.XtraTreeList.TreeList.EndUpdate()
at DevExpress.XtraTreeList.TreeList.OnLoadedCore(Boolean forceUpdateFilter)
at DevExpress.XtraTreeList.TreeList.OnLoadedCore(Boolean forceUpdateFilter)
at DevExpress.XtraTreeList.TreeList.OnLoadedCore()
at DevExpress.XtraTreeList.TreeList.OnLoaded()
at DevExpress.XtraEditors.Container.EditorContainer.OnVisibleChanged(EventArgs e)
at DevExpress.XtraTreeList.TreeList.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
at DevExpress.XtraTreeList.TreeList.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, UInt32 msg, WPARAM wparam, LPARAM lparam)
Windbg Log:
(3dc4.2dd8): C++ EH exception - code e06d7363 (first chance)
ModLoad: 00007ffe`441b0000 00007ffe`441bd000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\11.0.0-preview.4.26230.115\System.Web.HttpUtility.dll
ModLoad: 0000020c`91c30000 0000020c`91dca000 C:\Program Files\Autodesk\Inventor 2025\Bin\DevExpress.XtraTreeList.v22.2.dll
ModLoad: 0000020c`95560000 0000020c`95d26000 C:\Program Files\Autodesk\Inventor 2025\Bin\DevExpress.XtraEditors.v22.2.dll
ModLoad: 0000020c`95d30000 0000020c`9624e000 C:\Program Files\Autodesk\Inventor 2025\Bin\DevExpress.Data.v22.2.dll
ModLoad: 0000020c`96250000 0000020c`9633a000 C:\Program Files\Autodesk\Inventor 2025\Bin\DevExpress.Data.Desktop.v22.2.dll
ModLoad: 0000020c`96340000 0000020c`967c8000 C:\Program Files\Autodesk\Inventor 2025\Bin\DevExpress.Printing.v22.2.Core.dll
ModLoad: 0000020c`91dd0000 0000020c`91e8e000 C:\Program Files\Autodesk\Inventor 2025\Bin\DevExpress.Drawing.v22.2.dll
ModLoad: 00007ffe`43e70000 00007ffe`43e9e000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\11.0.0-preview.4.26230.115\System.ComponentModel.Annotations.dll
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.3228): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffe`43cc0000 00007ffe`43cdb000 C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\11.0.0-preview.4.26230.115\Microsoft.Win32.SystemEvents.dll
ModLoad: 00007ffd`8d450000 00007ffd`8d4c5000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\11.0.0-preview.4.26230.115\System.IO.Compression.dll
ModLoad: 00007ffd`8d300000 00007ffd`8d44b000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\11.0.0-preview.4.26230.115\System.IO.Compression.Native.dll
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
ModLoad: 00007ffd`8d1e0000 00007ffd`8d2fb000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\11.0.0-preview.4.26230.115\System.Reflection.Metadata.dll
ModLoad: 00007ffd`8d0f0000 00007ffd`8d1db000 C:\Program Files\dotnet\shared\Microsoft.NETCore.App\11.0.0-preview.4.26230.115\System.Collections.Immutable.dll
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
(3dc4.2dd8): CLR exception - code e0434352 (first chance)
CLR exception type: System.TypeInitializationException
"The type initializer for 'DevExpress.XtraEditors.OpenFormsGuard' threw an exception."
Regression?
Verify Scenarios:
1)Windows 10 21H2 AMD64 + dotnet-sdk-8.0.421-win-x64: Pass
2) Windows 10 21H2 AMD64 + dotnet-sdk-9.0.314-win-x64: Fail
3) Windows 10 21H2 AMD64 + dotnet-sdk-10.0.300-win-x64: Fail
4) Windows 11 24H2 AMD64 + dotnet-sdk-11.0.100-preview.4.26230.115: Fail
5) Windows 11 24H2 AMD64 + dotnet-sdk-11.0.100-preview.5.26261.101: Fail
Known Workarounds
No response
Configuration
Application Name: Autodesk Inventor 2025
OS: Windows 11 24H2
CPU: AMD64
.NET Build Number: dotnet-sdk-11.0.100-preview.5.26261.101
Application installer or repro machine checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2997117
dotnet --info
.NET SDK:
Version: 11.0.100-preview.5.26261.101
Commit: 547c640d56
Workload version: 11.0.100-manifests.46d55c8d
MSBuild version: 18.8.0-preview-26261-101+547c640d5
Runtime Environment:
OS Name: Windows
OS Version: 10.0.26100
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\11.0.100-preview.5.26261.101\
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 11.0.0-preview.5.26261.101
Architecture: x64
Commit: 547c640d56
.NET SDKs installed:
11.0.100-preview.5.26261.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 11.0.0-preview.5.26261.101 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 11.0.0-preview.5.26261.101 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 11.0.0-preview.5.26261.101 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other information
@dotnet-actwx-bot @dotnet/compat
Description
When run Autodesk Inventor 2025 against with .NET 9/10/11 runtime, we found it failed with an error "
The type initializer for 'DevExpress.XtraEditors. OpenFormsGuard' threw an exception", which starts from dotnet-sdk-9.0.314.Reproduction Steps
Repro steps: (Please refer to repro machine in DevDiv )
Expected behavior
“Add Numeric” button appears.
Actual behavior
It fails with an exception"
The type initializer for 'DevExpress.XtraEditors. OpenFormsGuard' threw an exception".Windbg Log:
Regression?
Verify Scenarios:
1)Windows 10 21H2 AMD64 + dotnet-sdk-8.0.421-win-x64: Pass
2) Windows 10 21H2 AMD64 + dotnet-sdk-9.0.314-win-x64: Fail
3) Windows 10 21H2 AMD64 + dotnet-sdk-10.0.300-win-x64: Fail
4) Windows 11 24H2 AMD64 + dotnet-sdk-11.0.100-preview.4.26230.115: Fail
5) Windows 11 24H2 AMD64 + dotnet-sdk-11.0.100-preview.5.26261.101: Fail
Known Workarounds
No response
Configuration
Application Name: Autodesk Inventor 2025
OS: Windows 11 24H2
CPU: AMD64
.NET Build Number: dotnet-sdk-11.0.100-preview.5.26261.101
Application installer or repro machine checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2997117
dotnet --info
Other information
@dotnet-actwx-bot @dotnet/compat