My steps:
Downloaded the library from https://github.com/sshnet/SSH.NET
Built the 3.5 framework one and copied the DLL at *\src\Renci.SshNet.NET35\bin\Debug\ into Unity assets
Wrote a script that should output "C" in a text field:
using System.IO;
using Renci.SshNet;
using Renci.SshNet.Common;
using Renci.SshNet.Sftp;
String Host = "ftp.csidata.com";
int Port = 22;
String RemoteFileName = "TheDataFile.txt";
String LocalDestinationFilename = "TheDataFile.txt";
String Username = "yourusername";
String Password = "yourpassword";
void Start(){
using (var sftp = new SftpClient(Host, Port, Username, Password))
{
sftp.Connect();
using (var file = File.OpenWrite(LocalDestinationFilename))
{
sftp.DownloadFile(RemoteFileName, file);
tex.text += "C";
}
sftp.Disconnect();
}
}
Build solution aimed at HoloLens:
SDK - Universal 10
Target device - Any device
UWP Build Type - D3D
Changed .dll settings to SDK: Any SDK ; ScriptingBackend: Dot Net ; Don't process: Checked
Unity version: 5.5.1f1
Visual Studio version: 2015 update 3
Expected results: Successful connection and letter "C" in text box
Actual results: No change to textbox. VS Debugger tells me:
> An exception of type> 'System.IO.FileLoadException' occurred> in Renci.SshNet.dll but was not> handled in user code>> Additional information: Could not load> file or assembly 'System.Core,> Version=3.5.0.0, Culture=neutral,> PublicKeyToken=b77a5c561934e089' or> one of its dependencies. The located> assembly's manifest definition does> not match the assembly reference.> (Exception from HRESULT: 0x80131040)
Thank you in advance for the help.
↧