Click here to Skip to main content
15,936,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I got an exception when i try to execute window application on another machine.

An exception of type 'System.Runtime.InteropServices.COMException' occurred and was caught.

C#
System.Runtime.InteropServices.COMException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Retrieving the COM class factory for component with CLSID {97EDD412-0626-4EB9-A344-3F344F00E93D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).


I am stuck here.Please help me.
Posted
Comments
skydger 2-Jan-14 6:47am    
How did you install your app to that machine? Are you sure that COM library exists on that computer? Did you register its COM interface with regsvr32 there?
goswami.tarun 2-Jan-14 7:04am    
I installed it same as any other application is install.
Yes, the COM library exists on that computer.
Please tell me how to register its COM interface with regsvr32 there in 32/64 bit operating system.

If your COM-interface implemented in 32 bit, just launch the console (cmd.exe), then type
%windir%\System32\regsvr32.exe yourlib.dll


If you have some installation script, consider to use autoregisration feature (if its available)

If your library is for 32 bit architecture and target system is x64, you should use then DllSurrogate[^].

For more information about DllSurrogate, please refer the following link:
Registering the DLL Server for Surrogate Activation[^]

Upd
Please refer to the following link to register your 32-bit COM object on 64-bit OS:
Using a 32-bit COM Object from a 64-bit Application[^]
 
Share this answer
 
v2
Comments
goswami.tarun 6-Jan-14 4:53am    
It is working fine in 32 bit operating system but having issues on 64 bit machine although i have registered the dll on 64 bit machine.
I got exception " Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))".
What else will i do to resolve this issue please do some help.
skydger 6-Jan-14 9:45am    
I've updated the solution, please follow that link. It should help.
I just set target machine to x86 then build the application and it worked for 32/64 bit OS.
Thanks to everyone for their valuable answers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900