Posted: 2013-05-29 06:45
I downloaded version 5.1.5 of WinSCP.exe (portable) and the .NET / COM Package to develop a simple VB.Net program to download some files from an SFTP server.
I added WinSCP.exe to the project and it gets copied when compiling to the directory with the program. I added a reference to the WinSCP.dll which i renamed to WinSCPnet.dll. When looking at the references page it copies it locally (like it should as it came from a network location). I was able to code the project with Visual Studio recognizing all functions and providing the tooltips to me. However, when i run it i get:
Could not load file or assembly 'WinSCP, Version=18.104.22.16861, Culture=neutral, PublicKeyToken=b5f19f5762436b89' or one of its dependencies. The module was expected to contain an assembly manifest.
When i comment out the session or sessionoptions code and declarations i can run the program, however with them i get the above message.
I searched on the forum and it suggested to use RegAsm to register it. When i run the command i get this:
G:\Utilities For Everyone\WinSCP\5.1.5>C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb
Microsoft (R) .NET Framework Assembly Registration Utility 4.0.30319.1
Copyright (C) Microsoft Corporation 1998-2004. All rights reserved.
RegAsm : error RA0000 : Could not load file or assembly 'file:///G:\Utilities For Everyone\WinSCP\5.1.5\WinSCPnet.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
I have even tried adding this to the application config file:
<loadFromRemoteSources enabled="true" />
But that didn't work either. Is there any suggestions?
Location: Prague, Czechia
Have you tried not renaming the assembly? (you will obviously need to remove the
You can post new topics in this forum
And it's free!