'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);
Complete thread:
- 'System.NullReferenceException' occurred in WeOn - cdrundles, 2008-04-09, 17:32
- Re: 'System.NullReferenceException' occurred - woddrazen, 2008-04-09, 18:27
- Re: 'System.NullReferenceException' occurred - cdrundles, 2008-04-09, 23:22
- Re: 'System.NullReferenceException' - woddrazen, 2008-04-09, 23:33
- Re: 'System.NullReferenceException' occurred - cdrundles, 2008-04-10, 00:13
- Re: 'System.NullReferenceException' - woddrazen, 2008-04-10, 08:39
- Re: 'System.NullReferenceException' occurred - cdrundles, 2008-04-14, 19:21
- Re: 'System.NullReferenceException' - woddrazen, 2008-04-10, 08:39
- Re: 'System.NullReferenceException' occurred - cdrundles, 2008-04-10, 00:13
- Re: 'System.NullReferenceException' - woddrazen, 2008-04-09, 23:33
- Re: 'System.NullReferenceException' occurred - cdrundles, 2008-04-09, 23:22
- Re: 'System.NullReferenceException' occurred - woddrazen, 2008-04-09, 18:27