(完全指定) 日志:Appbase = file:/// D:/ vinodh / Workout / SFTP_SharpSSH / SFTP_SharpSSH / bin / Debug / 日志:初始PrivatePath = NULL 调用程序集:Tamir.SharpSsh,Version = 1.1.1.13,Culture = neutral,PublicKeyToken = 4ed5f4288b4076af。 === 日志:此绑定在默认加载上下文中启动。 日志:使用a应用程序配置文件:D:\vinodh \ WORKout \SFTP_SharpSSH \SFTP_SharpSSH \bin \Debug \SFTP_SharpSSH.vshost.exe.Config 日志:使用主机配置文件: 日志:使用C:\ Windows \ Macrooft.NET \Framework\v4.0.30319 \ config \machine.config中的机器配置文件。 日志:政策后参考:DiffieHellman,Version = 0.0.0.0,Culture = neutral,PublicKeyToken = 4ed5f4288b4076af 日志:尝试下载新的URL文件:/// D:/ vinodh / Workout / SFTP_SharpSSH / SFTP_SharpSSH /bin/Debug/DiffieHellman.DLL。 WRN:比较程序集名称导致不匹配:PUBLIC KEY TOKEN 错误:无法完成程序集的设置(hr = 0x80131040)。探测终止。 我尝试过:Error:Session.connect: System.IO.FileLoadException: Could not load file or assembly 'DiffieHellman, Version=0.0.0.0, Culture=neutral, PublicKeyToken=4ed5f4288b4076af' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)File name: 'DiffieHellman, Version=0.0.0.0, Culture=neutral, PublicKeyToken=4ed5f4288b4076af' at Tamir.SharpSsh.jsch.jce.DH.getE() at Tamir.SharpSsh.jsch.DHG1.init(Session session, Byte[] V_S, Byte[] V_C, Byte[] I_S, Byte[] I_C) at Tamir.SharpSsh.jsch.Session.receive_kexinit(Buffer buf) at Tamir.SharpSsh.jsch.Session.connect(Int32 connectTimeout)=== Pre-bind state information ===LOG: DisplayName = DiffieHellman, Version=0.0.0.0, Culture=neutral, PublicKeyToken=4ed5f4288b4076af (Fully-specified)LOG: Appbase = file:///D:/vinodh/Workout/SFTP_SharpSSH/SFTP_SharpSSH/bin/Debug/LOG: Initial PrivatePath = NULLCalling assembly : Tamir.SharpSsh, Version=1.1.1.13, Culture=neutral, PublicKeyToken=4ed5f4288b4076af.===LOG: This bind starts in default load context.LOG: Using application configuration file: D:\vinodh\Workout\SFTP_SharpSSH\SFTP_SharpSSH\bin\Debug\SFTP_SharpSSH.vshost.exe.ConfigLOG: Using host configuration file:LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.LOG: Post-policy reference: DiffieHellman, Version=0.0.0.0, Culture=neutral, PublicKeyToken=4ed5f4288b4076afLOG: Attempting download of new URL file:///D:/vinodh/Workout/SFTP_SharpSSH/SFTP_SharpSSH/bin/Debug/DiffieHellman.DLL.WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKENERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.What I have tried:<pre> string _ftpURL = "jtend"; string _UserName = "kascope"; string _Password = "S@ssw0rd813"; int _Port = 22; string _ftpDirectory = @"/"; string LocalDirectory = @"E:\To_Upload"; string FileName = "tests.xls"; Sftp oSftp = new Sftp(_ftpURL, _UserName, _Password); oSftp.Connect(_Port); // Throws Error here string LocalDirectory1 = LocalDirectory + "/" + FileName; string ftpDirectory = _ftpDirectory + "/" + FileName; oSftp.Put(LocalDirectory + "/" + FileName, _ftpDirectory + "/" + FileName); oSftp.Close();推荐答案首先,您是否已将它们添加为项目的引用?如果已将它们添加为引用,是否确保已将它们设置为复制到输出目录? diffiehelman是否还有您需要复制的依赖项?它可能带有您需要在客户端上运行的运行时安装程序,以确保安装所有依赖项。First of all, have you added them as references to your project? If you have added them as references, have you made sure that you have set them to be copied to the output directory? Does diffiehelman have any dependencies that you need to copy across as well? It might come with a runtime installer that you need to run on your clients to ensure that all the dependencies are installed.错误消息的相关部分似乎是:The relevant part of the error message would seem to be: Quote: WRN:比较程序集名称导致不匹配:PUBLIC KEY TOKENWRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN 您下载的程序集与编译 Tamir.SharpSsh 的程序集不匹配。 如果找不到匹配的装配版本,则需要下载源 [ ^ ]并针对新版本重新编译DiffieHellman程序集。The assembly you've downloaded doesn't match the assembly that Tamir.SharpSsh was compiled against.If you can't find a matching version of the assembly, you'll need to download the source[^] and recompile it against the new version of the DiffieHellman assembly. 这篇关于无法加载文件或程序集'diffiehellman的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-25 02:01