none
System.InvalidOperationException was unhandled RRS feed

  • Question

  • System.InvalidOperationException was unhandled
      Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: Retrieving the COM class factory for component with CLSID {A98252EB-17D9-11D1-A181-0000F8773CDC} failed due to the following error: 80040154."
      Source="FactoryLoadTruck"
      StackTrace:
           at FactoryLoadTruck.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
           at FactoryLoadTruck.My.MyProject.MyForms.get_LoadTruck()
           at FactoryLoadTruck.My.MyApplication.OnCreateMainForm() in C:\Users\George\Documents\George\Software\BarCode(Truck Program)\Truck Programs 02-22-10\FactoryLoadTruck\FactoryLoadTruck\My Project\Application.Designer.vb:line 35
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
           at FactoryLoadTruck.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
           at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.Runtime.InteropServices.COMException
           Message="Retrieving the COM class factory for component with CLSID {A98252EB-17D9-11D1-A181-0000F8773CDC} failed due to the following error: 80040154."
           Source="FactoryLoadTruck"
           ErrorCode=-2147221164
           StackTrace:
                at FactoryLoadTruck.LoadTruck..ctor() in C:\Users\George\Documents\George\Software\BarCode(Truck Program)\Truck Programs 02-22-10\FactoryLoadTruck\FactoryLoadTruck\LoadTruck.vb:line 4
           InnerException:
    Friday, August 2, 2013 3:26 PM

Answers

  • There can be many reasons for this.

    1. First ensure that the COM component (OCX) represented by CLSID  {A98252EB-17D9-11D1-A181-0000F8773CDC} is registered. If not register it using RegSvr32.

    2. Also if the OCX has any dependencies, them make sure all of them are also present in the system.

    3. Lastly, if you are using 64 bit machine and your VB.NET application is compiled in 'Any CPU' or 'X64' mode, then try building the application in x86 mode. This is because, I think the OCX is a 32 bit component which cannot be loaded in 64 bit process.

    I hope this helps.


    Please mark this post as answer if it solved your problem. Happy Programming!

    Saturday, August 3, 2013 4:24 AM