-1

I'm trying to migrate an script written in Visual Basic from 32-bit Windows Server 2008 to a 64-bit Windows Server 2012 R2. The script connects to SQL Servers, performs some queries and executes calls to a vendor/third-party API.

The dll file with the vendor's API code was not included in the new server installation, so I copied it from the old server. In order for me to be able to add the dll (via Add Reference option) to the project, I had to run the dll through Tlbimp.exe.

When I try to run the executable for my script on the new Windows server, I get the infamous error:

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

I assume this is a complaint about the third party dll not being registered, so I have tried...

...setting the platform to x86

As per: Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154. In the MS Visual Basic 2010 Express IDE, I have set the platform to Active (x86) which is the only option I have.

...placing the dll in the System32 folder

...registering the dll

Using regsvr32.exe. But I gett he error:

The module "C:\Windows\SysWOW64\vendor.dll" was loaded but the entry-point DllRegisterServer was not found...

Admittedly, I don't know the basics when it comes to programming for Windows and I feel like I may be missing something simple or fundamental here.

How do I get my VB application to run on the new server with the vendor API (dll)?

Community
  • 1
  • 1
nmc
  • 8,724
  • 5
  • 36
  • 68

1 Answers1

0

This was indeed a silly error on my part...

When attempting to register the dll, I tried to register the dll that was converted by Tlbimp.exe (the one that I could add as a reference to the project), instead of the original dll file that I copied from the old server.

The original dll file registers successfully and the executable can now run.

nmc
  • 8,724
  • 5
  • 36
  • 68