Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

cthumann

Possible solution for some...

Keep in mind that Visual Studio references set the "Copy Local" property to true by default. So, when referencing the WinSCPnet.dll, it will copy it to your bin\output folder and run the DLL from that location. Therefore, the WinSCP.exe file would also need to be in the bin\output folder as well.

Based on your environment and requirements, either copy the WinSCP.exe file to the bin\output or set "Copy Local" to false for the WinSCPnet.dll reference, in which case it will always look in the referenced location for both files.
martin

@KevinCuffe: It's not something to be fixed. You have to accompany WinSCPnet.dll with matching version of WinSCP.exe.
See https://winscp.net/eng/docs/library_install#deploying

Btw, deploying anything to system folders is not a good idea in any case.

And you should upgrade your project to the latest version of WinSCP .NET assembly too. The 5.9.6 is rather old.
KevinCuffe

Hi, We are getting this is issue when executing transfers via Task Manager since upgrading to the latest versions, however manually transferring files works ok.
01/24/2022 15:00:01 Error: The version of C:\Program Files (x86)\WinSCP\winscp.exe (5.19.5.0) does not match version of this assembly C:\Windows\system32\WinSCPnet.dll (5.9.6.0).

The only way we can get this working again is to re-install 5.9.6.0 which isn't ideal.

Has a fix been found for this yet?
martin

Re: Randomly getting error "WinSCP.ExeSessionProcess.CheckVersion"

@pradip: Please attach debug log file (Session.DebugLogPath).
pradip

Randomly getting error "WinSCP.ExeSessionProcess.CheckVersion"

Error Message: Cannot use \bin\winscp.exe
Stack Trace: at WinSCP.ExeSessionProcess.CheckVersion(String exePath, FileVersionInfo assemblyVersion)
at WinSCP.ExeSessionProcess..ctor(Session session, Boolean useXmlLog, String additionalArguments)
at WinSCP.Session.Open(SessionOptions sessionOptions)
martin

Thanks. I've improved logging of the issue even more. Please try to reproduce the problem using a build I've just sent to your email address.
shagedorn

Hi Martin,

we updated to WinSCP 5.18.3 RC
I attached 2 log-files.
martin

Thanks. Can you try to upgrade to 5.18.2 beta? It has better logging of issues like this.
shagedorn

Hello Martin,

Thank you very much for your answer.

I am sending you 2 log files attached.

These are from the same system. This morning a file could be uploaded without any problems. This is the log debug-mmg_03032021.log.

An hour later another file should be uploaded. However, this failed due to the known bug. This is the log debug-mft_03032021.log

Nothing has changed during this time.
Just for information: Yesterday 2 uploads could be carried out without any problems.
Maybe you have an idea what else we can do.
martin

Re: The version of exe does not match version of this assembly

Please attach a full debug log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.DebugLogPath. Submit the log with your post as an attachment. If you do not want to post the log publicly, you can mark the attachment as private.
shagedorn

winscp.exe does not match version of the assembly

Since the update to version 5.17.10 we keep getting this error.
'The version of C: \ Program Files (x86) \ WinSCP \ winscp.exe does not match version of this assembly C: \ Program Files (x86) \ WinSCP \ WinSCPnet.dll (5.17.10.0). '

Sometimes it works and the next day it doesn't. It occurs quite arbitrarily.
Both WinSCP.exe and WinSCPnet.DLL are from version 5.17.10

We have completely uninstalled WinSCP. The complete registry cleaned up. Without success.
Before the update to 5.17.10 everything worked without any problems. Unfortunately we were forced to replace the old version 5.5.4.0.

Since it is probably the same error as described above, the question whether there is already a solution? We are grateful for every tip.
elghali

Is there a resolution for this issue ? thanks
martin

Re: The version of exe does not match version of this assembly

@kiranvm111: Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include a link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
kiranvm111

Re: The version of exe does not match version of this assembly

Are you able to find solution for this.
Please share the resolution
tattdogg

New debug log file is attached
tattdogg

Thanks. I'll send new debug log file as soon as possible
martin

Thanks. I have sent you an email with a debug version of WinSCP to the address you have used to register on this forum.
tattdogg

Hi martin
Debug log file is attached
martin

Re: The version of exe does not match version of this assembly

Please attach a debug log file (Session.DebugLogPath).
tattdogg

The version of exe does not match version of this assembly

Hi guys

Exception message:
The version of C:\Program Files (x86)\WinSCP\5.17.3.0\WinSCP.exe () does not match version of this assembly F:\MyTask\WinSCPnet.DLL (5.17.3.0).

Stack trace:
WinSCP.ExeSessionProcess.CheckVersion(String exePath, FileVersionInfo assemblyVersion):260
WinSCP.ExeSessionProcess..ctor(Session session, Boolean useXmlLog, String additionalArguments):151
WinSCP.Session.Open(SessionOptions sessionOptions):944
MyTask.Core.FtpClient.get_Session():188

It looks like assembly cannot detect the version of executable file
I've checked both files (exe and dll) and the version for both is 5.17.3.0
I have lots of apps that can work with this exe file at the same time
This error occurs randomly