Topic ".NET Assembly not working"

Author Message
dtrowan
[View user's profile]

Joined: 2013-05-29
Posts: 3
Location: Australia
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:

Quote:
Could not load file or assembly 'WinSCP, Version=1.0.6.3261, 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:

Quote:
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:

Code:

    <runtime>
        <loadFromRemoteSources enabled="true" />
    </runtime>


But that didn't work either. Is there any suggestions?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
Have you tried not renaming the assembly? (you will obviously need to remove the winscp.exe from the project and copy it to the output folder manually).
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License