How to register WinSCP .NET assembly in VB6

3.4k views Asked by At

I want to convert FTP to SFTP in an old VB6 application. So I was suggested to use WinSCP.

WinSCP has WinSCPnet.dll which needs to be registered in VB6 but I am unable to add it as a reference in VB6. I tried Projects -> Reference -> Browse -> Add. But I'm getting

Can't add a reference for the specified file.

So how will I register this DLL in VB6 and use it?

3

There are 3 answers

0
nabuchodonossor On BEST ANSWER

On their website I found this:

%WINDIR%\Microsoft.NET\Framework\<version>\RegAsm.exe WinSCPnet.dll /codebase /tlb
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll/codebase /tlb:WinSCPnet32.tlb
%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet64.tlb

read this part of the site:

https://winscp.net/eng/docs/library_install#registering

0
Suman George On

I am able to register WinSCP successfully. Thanks for all the help. As nabuchodonossor suggested in the post we need to first register for COM. this is the command: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet32.tlb Once this was done I went to Project -> References -> Browse -> Choose WinSCPnet32.tlb from system32 folder.

This will get the task done.

0
Margaryta U On

You should register through command line as an administrator.

I have been trying to register my .dll library for a while after switching to Windows 10 and everything was failing until I did that.