Topic "Could not load file or assembly 'WinSCPnet' or one of its..."

Author Message
[View user's profile]

Joined: 2012-12-08
Posts: 1
Hi all,

I have an existing ASP.NET project and trying to incorporate WinSCPs SFTP functionality into this project.

I have followed the instructions on the .NET assembly / COM library section and performed the following actions:
- Renamed WinSCP.dll to WinSCPnet.dll
- Added the WinSCPnet.dll as a reference
- Added WinSCP.exe and the original WinSCP.dll into my project and set them to be copied to the output folder as per instructions

When I test the project that the WinSCP stuff is in, everything works fine.
But when I build the whole ASP.NET project and try to access the website, I get this error:

Could not load file or assembly 'WinSCPnet' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This seems to be happening because the name of the WinSCP.dll has been changed to WinSCPnet.dll to get round the namespace conflict (as described in the instructions).
When I delete the WinSCPnet.dll from the bin directory the website works fine.

Has anyone else come across this?
Any ideas who to fix it?

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
The .NET assembly will have name WinSCPnet.dll officialy since the next major release.

The only workaround for you until that, is not to rename the assembly. You can rename winscp.exe instead, or avoid including it into the project (and use Session.ExecutablePath to point to the new name or different location).

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License