'System.NullReferenceException' occurred in WeOn (General questions)
When I execute the following code from a console application, it works fine (connects to server, transfers, etc.)
When I execute it on a background thread from a Windows Form I get the subject exception on the line:
new WeOnlyDo.Client.SFTP
I verified that the license key string is retrieved from the (encrypted) config file.
Here is a snippet:
Configuration appConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConnectionStringsSection connSection = appConfig.ConnectionStrings;
uploadServer.sftpClient = new WeOnlyDo.Client.SFTP();
// for use of WeOnlyDo DLL
uploadServer.sftpClient.LicenseKey = connSection.ConnectionStrings[ LicenseKey ].ConnectionString;
uploadServer.sftpClient.Hostname = connSection.ConnectionStrings[ ISSServer ].ConnectionString;
uploadServer.sftpClient.Login = connSection.ConnectionStrings[ TestUser ].ConnectionString;
uploadServer.sftpClient.Password = connSection.ConnectionStrings[ TestPassword ].ConnectionString;
uploadServer.sftpClient.Blocking = true; // not asynchronous
uploadServer.sftpClient.Timeout = 60; // autodisconnect on inactivity in seconds, 0 means no timeout.
uploadServer.Connect(remotePath, uploadWorker);