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.
This is a summary of our conversation that took place beneath the question.
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.
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:
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.
Failing that, look in All Objects.