0

I have registered a library with RegAsm.exe. The following commands are tested in PowerShell:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /codebase /tlb C:\Users\mostafa.khodakarami\source\repos\SinapLogo\SinapLogo\DLLs\Interop.UnityObjects.dll    
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\RegAsm.exe /codebase /tlb C:\Users\mostafa.khodakarami\source\repos\SinapLogo\SinapLogo\DLLs\Interop.UnityObjects.dll    
C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase /tlb C:\Users\mostafa.khodakarami\source\repos\SinapLogo\SinapLogo\DLLs\Interop.UnityObjects.dll    
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe /codebase /tlb C:\Users\mostafa.khodakarami\source\repos\SinapLogo\SinapLogo\DLLs\Interop.UnityObjects.dll

And Tested without /codebase and /tlb.

But couldn't find library in COM But couldn't find library in COM

So I decided to add dll file directly as a reference (I know it's wrong but just for test). The following exception raised:

Retrieving the COM class factory for component with CLSID {72DB412A-6BF5-4920-A002-2AAC679951DF} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

So according to microsoft documents the registered library's guid can be found in the following path:

HKEY_CLASSES_ROOT\CLSID\{72DB412A-6BF5-4920-A002-2AAC679951DF}

And it is: And it is

And restarted my PC. After reboot the library is not showing in COM libraries. So what is the tiny job that should be done to see the library in Reference Manager window?

The library is 64-bit (maybe written by visual basic) not registerable with Regsrv32 command.

It should be registered according to it's author documents: author documents

x86, x64 and Any CPU platform targets are tested.

Update: Library is registered in Wow6432Node too Library is registered in Wow6432Node too

  • You don't want to register for CLR 2 (unless CLR 4 is not installed at all). Are you sure the 4 commands succeeded w/o any warning? Is the .dll built for Any CPU? Also check the 32-bit registry (Wow6432Node) https://stackoverflow.com/questions/3936146/hkey-current-user-software-wow6432node-classes-vs-hkey-current-user-software-cla as for the fact the typelib is not visible, check HKEY_CLASSES_ROOT\TypeLib\ and HKEY_CLASSES_ROOT\WOW6432Node\TypeLib\ too – Simon Mourier Jun 28 '21 at 10:03
  • Thanks for your comments. I installed for CLR4 then after not seeing the library in COM, tried CLR 2. My system and the library are in 64bit. the registeration can be confirmed on both Wow64 and 32bit node(shown in picture). The first installation was successfull, after that only has a warning for existing installation. According to company document the library should be added with COM(it shows a picture for it). – Mostafa Khodakarami Jun 28 '21 at 10:12
  • Your picture just just shows the "same as OS bitness" part of the registry (so I guess only the 64-bit). REGDB_E_CLASSNOTREG means the class is not registered for the bitness the code trying to get the class is running, there's hardly anything around that. Otherwise use the ProcMon tool from sysinternals and filter by registry (and maybe process name) see what really happens. – Simon Mourier Jun 28 '21 at 10:18
  • Yes you are right with REGDB_E_CLASSNOTREG as the exception message pointed this `Class not registered`. I have updated my question to show extra information. I will try ProcMon tool. Thanks – Mostafa Khodakarami Jun 28 '21 at 10:30
  • Do **not** use Regasm, this interop library should be selected through the Assemblies tab. You did destroy the registration for the COM library doing so, you have to reinstall the component. I found [this forum post](https://forum.logo.com.tr/index.php?page=details&konu=2-45-0-0-setinde-lobject-hatasi), looks like you have to run register.bat. I think, I don't speak Turkish. Do contact the vendor for support if you still have trouble. – Hans Passant Jun 30 '21 at 01:31
  • Thanks @HansPassnt. Yes I found this and it is working. The truth is that the library shouldn't be registered directly to `COM`. Another `exe` file should be registered and that will register the desired library to `COM`. The batch file that you mention registers many things that are not necessary but could be helpful. To appreciate your help please post your comment as answer to be accepted. – Mostafa Khodakarami Jun 30 '21 at 04:58

0 Answers0