Lỗi debug Autodesk Advance steel C# trong Visual Studio - Managed Debugging Assistant 'FatalExecutionEngineError'

Hi!

Mình đang tạo Add-in cho Advance steel (tương tự autocad, revit) bằng C# trên Visual Studio, tuy nhiên khi chạy debug thì hiện lỗi, phần mềm ko chạy được. Lỗi như sau:

Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0xbb0df2c4, on thread 0x640. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Output

'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\Acdbmgd.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AdApplicationFrame.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\adui24.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AdUiPalettes.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsBase\v4.0_4.0.0.0__31bf3856ad364e35\WindowsBase.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\PresentationCore\v4.0_4.0.0.0__31bf3856ad364e35\PresentationCore.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xaml\v4.0_4.0.0.0__b77a5c561934e089\System.Xaml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'c:\program files\microsoft visual studio\2022\community\common7\ide\commonextensions\microsoft\xamldiagnostics\Framework\x64\Microsoft.VisualStudio.DesignTools.WpfTap.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AdUIMgd.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Internals\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Internals.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 0x7b80 has exited with code 0 (0x0).
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AdWindows.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\WindowsFormsIntegration\v4.0_4.0.0.0__31bf3856ad364e35\WindowsFormsIntegration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero2\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero2.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\accoremgd.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\acmgd.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AcWindows.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\en-US\AcWindows.resources.dll'. Module was built without symbols.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AcCui.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXml\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Aero\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Aero.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework.Luna\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.Luna.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationUI\v4.0_4.0.0.0__31bf3856ad364e35\PresentationUI.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework-SystemXmlLinq\v4.0_4.0.0.0__b77a5c561934e089\PresentationFramework-SystemXmlLinq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\AppHomeInterop.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\Serilog.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\Autodesk.DesktopConnector.API.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files\Autodesk\AutoCAD 2022\Serilog.Sinks.File.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\canhq\AppData\Roaming\Autodesk\ApplicationPlugins\Autodesk Save to Web and Mobile.bundle\Contents\AutoCAD\Win64\AcCloudAccess.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\canhq\AppData\Roaming\Autodesk\ApplicationPlugins\Autodesk Save to Web and Mobile.bundle\Contents\AutoCAD\Win64\en-US\AcCloudAccess.resources.dll'. Module was built without symbols.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'Microsoft.GeneratedCode'.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Program Files (x86)\Autodesk\ApplicationPlugins\Autodesk FeaturedApps.bundle\Contents\Windows\2022\Win64\FeaturedAppsPlugin.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\ProgramData\Autodesk\ApplicationPlugins\VisualInfraCad.bundle\Contents\VisualInfra_Ribbon_Cad.dll'. Module was built without symbols.
'acad.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'akhelVezUBFsYbZCwdHHzAXkSLsx'. Module was built without symbols.
Managed Debugging Assistant 'FatalExecutionEngineError'
The runtime has encountered a fatal error. The address of the error was at 0xbb0df2c4, on thread 0x640. The error code is 0x80131623. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

The program '[27768] acad.exe' has exited with code 4294967295 (0xffffffff).

Mọi người chỉ mình cách khắc phục với, Cảm ơn nhiều!

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?