WinSCP.SessionLocalException:在程序集 WinSCPnet 的位置未找到 winscp.exe 可执行文件

WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet

我刚开始在实验室工作,负责将数据从本地计算机发送到 HPC。我整天都在解决以下我根本不熟悉的问题。

4/19/2022 3:21:28 PM ERROR: WinSCP.SessionLocalException: The winscp.exe executable was not found at location of the assembly WinSCPnet (C:\WRGLPipeline\WRGLPipeline\bin\dlls), nor the entry assembly WRGLPipeline (C:\WRGLPipeline\WRGLPipeline\bin), nor in an installation path. You may use Session.ExecutablePath property to explicitly set path to winscp.exe.
   at WinSCP.ExeSessionProcess.GetExecutablePath()
   at WinSCP.ExeSessionProcess..ctor(Session session, Boolean useXmlLog, String additionalArguments)
   at WinSCP.Session.Open(SessionOptions sessionOptions)
   at WRGLPipeline.PanelPipelineWrapper.ConnectToIridis()
   at WRGLPipeline.PanelPipelineWrapper.UploadAndExecute()
   at WRGLPipeline.PanelPipelineWrapper.ExecutePanelPipeline()
   at WRGLPipeline.Programme.Main(String[] args)

到目前为止,我一直在阅读文档和论坛,在我的目录中一切正常,但我想确保这一点,因为我实际上是 Windows 机器上的新手。

这是我的 bin 文件夹的结构

.
├── WRGLPipeline.exe
├── WRGLPipeline.exe.config
├── WRGLPipeline.ini
├── dlls
│   ├── CommandLine.dll
│   ├── Microsoft.Extensions.Configuration.Abstractions.dll
│   ├── Microsoft.Extensions.Configuration.FileExtensions.dll
│   ├── Microsoft.Extensions.Configuration.Ini.dll
│   ├── Microsoft.Extensions.Configuration.dll
│   ├── Microsoft.Extensions.FileProviders.Abstractions.dll
│   ├── Microsoft.Extensions.FileProviders.Physical.dll
│   ├── Microsoft.Extensions.FileSystemGlobbing.dll
│   ├── Microsoft.Extensions.Primitives.dll
│   ├── System.Buffers.dll
│   ├── System.Memory.dll
│   ├── System.Numerics.Vectors.dll
│   ├── System.Runtime.CompilerServices.Unsafe.dll
│   ├── System.Security.Cryptography.Algorithms.dll
│   ├── System.Security.Cryptography.Primitives.dll
│   ├── System.ValueTuple.dll
│   └── WinSCPnet.dll
└── keys
    ├── nhs.key
    └── soton.key

据我所知,可执行文件位于 bin 文件夹中。现在我在家查看此文件,是否需要在 dlls 文件夹中保留我的可执行文件的副本?按照错误消息,如果我需要指定 Session.ExecutablePath,应该在哪里?

这些是编译应用程序之前的文件

├── AuxillaryFunctions.cs
├── Coverage.cs
├── FileManagement.cs
├── GenerateGenotypingVCFs.cs
├── GenotypingPipelineWrapper.cs
├── Manual
│   └── WRGLPipeline-Manual.md
├── MyeloidPipelineWrapper.cs
├── PanelPipelineWrapper.cs
├── ParseArgs.cs
├── ParseBED.cs
├── ParseSampleSheet.cs
├── ParseVCF.cs
├── Programme.cs
├── ProgrammeParameters.cs
├── Properties
│   └── AssemblyInfo.cs
├── Static
│   ├── PipelineInterface.exe
│   ├── WRGLPipeline.ini
│   └── WRGL_logo.ico
├── WRGLPipeline.csproj
├── WRGLPipeline.csproj.user
├── app.config
└── packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="CommandLineParser" version="2.8.0" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.Abstractions" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.FileExtensions" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.Configuration.Ini" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.FileProviders.Abstractions" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.FileProviders.Physical" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.FileSystemGlobbing" version="3.1.9" targetFramework="net472" />
  <package id="Microsoft.Extensions.Primitives" version="3.1.9" targetFramework="net472" />
  <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
  <package id="System.Memory" version="4.5.4" targetFramework="net472" />
  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net472" />
  <package id="WinSCP" version="5.17.10" targetFramework="net47" />
</packages>

您似乎认为错误是指您的应用程序的 .exe (WRGLPipeline.exe)。它不是。它指的是WinSCP.exe。 WinSCP .NET 程序集 WinSCPnet.dll 需要 WinSCP.exe 二进制文件才能工作。

https://winscp.net/eng/docs/library_install#installing

最简单的解决方案是使用包含两个二进制文件的 WinSCP NuGet package