Could not create object named "WinSCP.SessionOptions"

Advertisement

TonyLiang
Guest

Could not create object named "WinSCP.SessionOptions"

I did register the WinSCPNet.dll (in both my personal computer and the server computer) by:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "L:\Shared_Softwares\WinSCP\WinSCPnet.dll" /codebase /tlb:WinSCPnet32.tlb
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe "L:\Shared_Softwares\WinSCP\WinSCPnet.dll" /codebase /tlb:WinSCPnet64.tlb

I tested my code on my personal computer and it works. But I got the error message when I tried to run the WSF file in the server:
"could not create object named "WINSCP.SessionOptions".

If I unregister the WinSCPnet.dll, I will get a different error message:
"Cannot find the type library for this reference : WinSCP.Session"
Which means before unregistered,WinSCPnet.dll did be registered.

Could anyone help with this? I see several similar threads post, but none of them are resolved.

Thanks,
Tony

Reply with quote

Advertisement

TonyLiang
Guest

MoreInfo

More info:
My personal computer is Win 7 via the server computer is Win 10. Not sure whether the Windows version makes any differences.

Thanks,
Tony

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Could not create object named "WinSCP.SessionOptions"

TonyLiang wrote:

If I unregister the WinSCPnet.dll, I will get a different error message:
"Cannot find the type library for this reference : WinSCP.Session"
Which means before unregistered,WinSCPnet.dll did be registered.
This is actually suspicious, as it refers to Session, not SessionOptions, while it seems that your code first refers to SessionOptions, not Session.

Make sure that there's no other version of the assembly registered on the server.
Search HKEY_CLASSES_ROOT key in Windows Registry for 56FFC5CE-3867-4EF0-A3B5-CFFBEB99EA35.

Reply with quote

TonyLiang
Guest

registry editing disabled by Administrator

Hi Martin,

Thanks for your quick reply and the possible solution. I am not able to search the key in the registry since registry editing is disabled by the Administrator. Does this affect the installation of the WinSCPNet.dll? If this is the reason, I would ask the Adminstrator install the dll for me.

Thanks,
Tony

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: registry editing disabled by Administrator

TonyLiang wrote:

Thanks for your quick reply and the possible solution. I am not able to search the key in the registry since registry editing is disabled by the Administrator. Does this affect the installation of the WinSCPNet.dll? If this is the reason, I would ask the Adminstrator install the dll for me.
You do not need Administrator access to install the assembly.
Not sure what you mean by "registry editing is disabled". You do not need registry editing to search registry. Maybe you mean that you cannot run regedit.
You can search the registry using PowerShell for example
https://stackoverflow.com/q/42963661/850848

Reply with quote

Advertisement

You can post new topics in this forum