Search code examples
vb.netwinformsvisual-studiovisual-studio-2015com

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


I'm on visual studio 2015 trying to use a com object. The com object is srxCOM.dll to call the API of the titan ftp server.

Some documentation here

Download here (I installed the 64bit version)

Now what I've done is:

  1. List item
  2. Install the titan ftp server
  3. Register the com object (both from windows\system32 and windows\syswow64 as well) succeeded and can be found in the registry
  4. Add the reference to the COM object
  5. Add some code (Dim srxcom As New SRXCOMLib.SRXTitanClass())
  6. Set solution is set to compile to "Target CPU: x86"
  7. Start in debug mode.

Then I get the error telling me that the class is not registered although it clearly is. Did anyone work with Titan FTP in the past and share some tips?

Thanks


Solution

  • Okay I figured out what the problem was. Essentially when you open the project file (.proj) of visual studio in a text editor you'll find all the settings etc in XML format. So I did that and found the line that specifies the target CPU:

    <PlatformTarget>AnyCPU</PlatformTarget>
    

    Removed the line and it started working.