Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.3k views
in .NET FTP by (160 points)
I am using 1.2.5 edtftpnet.dll, with dot net framework 2.0. Randomly I get error "Exception has been thrown by the target of an invocation" while uploading the file. I have loop which keep on uploading the files from particular directory. It work file for most of the time but once a while it give this error and then it never uploads that file in the loop. I have to stop the program and then restart it. Then it will work fine. Please tell me how to overcome this problem. My code is as follows:

FTPcon = new EnterpriseDT.Net.Ftp.FTPConnection();

private void connectionToFTP()
{
FTPcon.ServerAddress = "255.255.255.0";
FTPcon.UserName = "administrator";
FTPcon.Password = "*****";
FTPcon.Connect();
}

private void FTPUploadAutomatically()
{

for (int i = 0; i < lstFiles.Items.Count; i++)
{
if (!FTPcon.IsConnected)
{
connectionToFTP();
}
try
{
FTPcon.UploadFile( lstFiles.Items[i].Text , FTPPath + lstFiles.Items[i].Text );
}
}

3 Answers

0 votes
by (162k points)
Please examine the log file at DEBUG level, and post the relevant segment.
0 votes
by (160 points)
I replaced edtftp version 1.2.5 with 1.2.2 and it gives error as "Value of '103' is not valid for 'Value'. 'Value' should be between 'minimum' and 'maximum'." File size which give problem is 1.50 KB (1,536 bytes). When same code run in dot net framework 1.1 then it uploads the file.
0 votes
by (162k points)
Can you post the stack traces?

Categories

...