System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed
Asked Answered
G

1

1

I am running a c# application and I am using DSOFile dll. This DLL is referenced in the project. I am able to run the exe in my development machine. But when I run the exe in another machine, I am getting

Unhandled Exception: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {58968145-CF05-4341-995F-2EE093F6ABA3} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Not sure why I am getting this. Have googled and set the Platform target to x86 But still I am getting this issue. Any help would be great.

Grindlay answered 9/2, 2016 at 5:30 Comment(4)
I'm guessing the COM library is not registered on the other computer. Try doing a regsvr32.exe DSOFile.dll from the command-line with admin rights on the target systemMoustache
Thanks a lot MickyD. In this scenario, do I need to register this COM library in each of the machines where exe is running?Grindlay
Thanks MickyD. I dont remember doing this in my Dev machine. This makes me wondering is there something else I am missingGrindlay
Ah the 'ol' "It works on my machine argument" ;) Without knowing what the DSOFile library does, it's quite possible it was registered on your box without you being aware. Perhaps some installer? Anyway check out my suggestion below.Moustache
M
3

This is a summary of our conversation that took place beneath the question.


80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

That means COM object you are trying to instantiate is a class that is not COM registered. COM uses the registry to maintain class registrations.

Try doing a regsvr32.exe DSOFile.dll from the command-line with admin rights on the target system.

I dont remember doing this in my Dev machine. This makes me wondering is there something else I am missing

Yes, try the following check:

Quick check

I recommend using Microsoft's free tool OleView (normally installed with Visual Studio) to check all things COM but in the event you don't have it, open up RegEdit and see if the following key exists:

HKCR\CLSID\{58968145-CF05-4341-995F-2EE093F6ABA3}

If it's not present on the target machine, then DSOFile is not registered.

If it is there, expand the above key and you should see a child key called InprocServer32. The (Default) value for this key will be the path to the DLL, in this case DSOFile.dll.

More

If you want to use OleView, take a look in:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\

Actual location may vary based on version of Visual Studio or Windows SDKs installed I suspect.

Once running, look in Automation Objects for your class.

enter image description here

Failing that, look in All Objects.

enter image description here

Moustache answered 9/2, 2016 at 5:40 Comment(2)
Thanks a lot Micky. I will follow your instructions. Thanks a ton.Grindlay
Adding to this since I just had an issue: If you're on a 64-bit system, DSOFile.dll doesn't work. You will need to run "regsvr32.exe DSOFile_x64.dll"for the 64-bit version.Balmy

© 2022 - 2024 — McMap. All rights reserved.