You are currently reviewing an older revision of this page.
The following error is appearing:
"System.TypeInitializationException"
When closing the program:
System.TypeInitializationException: The type initializer for 'Haestad.Domain.LibraryObjects.EngineeringLibraryService' threw an exception. ---> System.Runtime.InteropServices.SEHException: External component has thrown an exception. at DAO.Workspace.CreateDatabase(Workspace* , _com_ptr_t<_com_IIID>* , _bstr_t* Name, _bstr_t* Connect, _variant_t* Option) at CDaoDatabase.CreateDatabase(CDaoDatabase* , _bstr_t* filename, SByte*locale) at Haestad.Domain.DaoInterop.DaoDatabase.CreateDatabase(String fileName,CultureInfo locale) at Haestad.Domain.LibraryObjects.JetAppSettings.OpenRegistryDatabase(StringfileName) at Haestad.Domain.LibraryObjects.EngineeringLibraryService.OpenImpl()
When opening the program:
System.TypeInitializationException: The type initializer for 'Haestad.Domain.LibraryObjects.EngineeringLibraryService' threw an exception.
Haestad.Domain.DaoInterop.DAOException (0x80040154): COMerror not documented at Haestad.Domain.DaoInterop.InteropLibrary.ThrowCOMException(_com_error* e) at Haestad.Domain.DaoInterop.DaoDatabase.CreateDatabase(String fileName, CultureInfo locale) at Haestad.Domain.LibraryObjects.JetAppSettings.OpenRegistryDatabase(String fileName) at Haestad.Domain.LibraryObjects.JetAppSettings..ctor(String filename) at Haestad.Domain.LibraryObjects.EngineeringLibraryService.OpenImpl() at Haestad.Domain.LibraryObjects.EngineeringLibraryService..cctor()
When opening a file:
at Haestad.Domain.LibraryObjects.EngineeringLibraryService.set_ProjectWiseManager(ProjectWiseManager value) at Haestad.Framework.Application.ProjectManagerBase.get_ProjectWiseManager() at Haestad.Framework.Application.ProjectManagerBase.get_IsProjectWiseAvailable() at Haestad.Framework.Application.HaestadParentFormModel.get_IsProjectWiseAvailable() at Haestad.Drawing.Control.Application.GraphicalParentFormUIModelBase.Initialize() at Haestad.Drawing.Control.Forms.GraphicalDrawingParentForm.DoLazyInitialization(Boolean lazyInitialize) at Haestad.Drawing.Control.Forms.GraphicalDrawingParentForm.FileNew() at Haestad.Montana.Forms.MontanaXMParentForm.FileNew() at Haestad.Framework.Windows.Forms.Forms.WelcomeForm.buttonCreateNewProject_Click(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
The error could be occurring because of unregistered DAO. See this article for steps to register the DAO360.dll file.
You can find the steps to upgrade to the latest version here.
Delete the engineering libraries
How do I download the Water and Storm-Sewer hydraulics and hydrology products?
How to register DAO360.dll or a dll file
How to Delete Engineering Libraries