System.Runtime.InteropServices.COMException was unhandled by user code

-1

first of all I searched for my issue on Stackoverflow and I believe I attempted all the suggestions to the similar questions\answers.

We have a Windows forms application that uses Windows 10 and runs on several machines. This application uses One click publishing and we have a tool that helps clear memory issues. So far this problem is only happening on three machines with mine being one of them. Our other programmer has no issues running this application as the exe or in the IDE. I cannot even run it in the IDE.

When this first using the IDE I received the following message:

System.Runtime.InteropServices.COMException was unhandled by user code

  ErrorCode=-2147221164

  HResult=-2147221164

  Message=Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

  Source=System.Windows.Forms

  StackTrace:

       at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)

       at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)

       at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)

       at System.Windows.Forms.AxHost.CreateInstance()

       at System.Windows.Forms.AxHost.GetOcxCreate()

       at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)

       at System.Windows.Forms.AxHost.CreateHandle()

       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

       at System.Windows.Forms.AxHost.EndInit()

       at Application_Name.frmMain.InitializeComponent() in C:\Source\ApplicationName\Forms\frmMain.Designer.vb:line 1090

       at Application_Name.frmMain..ctor() in C:\Source\ApplicationName\Forms\frmMain.vb:line 10

Using TFS (Source Control) I renamed the original target folder and did a Get Latest and the below is the new message:

  {System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. 

  The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) ---> System.Runtime.InteropServices.COMException: Class not registered

  (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" & vbCrLf & "  

  at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter,

  Int32 context, Guid& iid)" & vbCrLf & "  

  at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)" & vbCrLf & "  

  at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)" & vbCrLf & "  

  at System.Windows.Forms.AxHost.CreateInstance()" & vbCrLf & "  

  at System.Windows.Forms.AxHost.GetOcxCreate()" & vbCrLf & "  

  at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)" & vbCrLf & "  

  at System.Windows.Forms.AxHost.CreateHandle()" & vbCrLf & "  

  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)" & vbCrLf & "  

  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)" & vbCrLf & "  

  at System.Windows.Forms.AxHost.EndInit()" & vbCrLf & "  

  at Application_Name.frmMain.InitializeComponent() in C:\Source\ApplicationName\Forms\frmMain.Designer.vb:line 1090" & vbCrLf & "  

  at Application_Name.frmMain..ctor() in C:\Source\ApplicationName\Forms\frmMain.vb:line 10" & vbCrLf & "   --- End of inner exception stack trace ---" & vbCrLf & "  

  at Application_Name.My.MyProject.MyForms.Create__Instance__[T](T Instance) in :line 190" & vbCrLf & "  

  at Application_Name.My.MyProject.MyForms.get_frmMain()" & vbCrLf & "  

  at Application_Name.My.MyApplication.OnCreateMainForm() in C:\Source\ApplicationName\My Project\Application.Designer.vb:line 35" & vbCrLf & "  

  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()" & vbCrLf & "  

  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()" & vbCrLf & "  

  at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)" & vbCrLf & "  

  at Application_Name.My.MyApplication.Main(String[] Args) in :line 81" & vbCrLf & "  

  at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)" & vbCrLf & "  

  at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)" & vbCrLf & "  

  at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()" & vbCrLf & "  

  at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)" & vbCrLf & "  

  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)" & vbCrLf & "  

  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)" & vbCrLf & "  

  at System.Threading.ThreadHelper.ThreadStart()}

I compared all my references with the other programmer's and they all match.

At first I removed a DLL I created on week earlier and its related code and then the Microsoft Excel 15.0 Object Library and the Microsoft Visual Basic for Applications Extensibility. Still got the error….

I proceeded to remove OFFICE, Crystal and Infragistics references commented out just about all the code and deleted all the controls. The application finally opened but with nothing in it (I had removed everything).

When I backed up the original folder and did the new Get Latest. I no longer received the same messages but the application still did not run. I got messages that AxInterop.AcroPDFLib and PDFMerge were not defined. They should have been copied over when I did the Get Latest.

I tried exe’s from earlier builds and I and they did not open at all there were no messages.

In Properties\Compile I tried changing the Target CPU to AnyCPU and x64.

I Experimented with registering the DLL I created (but do not suspect as the problem) but got the message that it was loaded but the entry-point DLLRegisterServer was not found. A search on that revealed more work so I put that aside for the time being.

I kind of suspect it is the Infragistics stuff but as mentioned the references appear okay and the application runs on most other's machines.

Please help.

vb.net
visual-studio-2015
asked on Stack Overflow Apr 28, 2020 by Tilting Code

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0