Closed A-Force closed 7 years ago
Could you provide the full stack trace of the exception, including the inner exceptions, if any?
I am unable to get the details of the exception, since it does not trigger my try-catch block. I tried changing exception settings to break on all exceptions, which caused a breakpoint but no detail was available except: System.Threading.ThreadInterruptedException occurred Message: Exception thrown: 'System.Threading.ThreadInterruptedException' in mscorlib.dll Additional information: Thread was interrupted from a waiting state.
It said something about viewing details in the "Disassembly" but frankly i dont know how to do that.
Thank you for your interest and quick response by the way.
When the exception is thrown, it generates a breakpoint. Can't you then just watch the exception being thrown? There should be at least one stack trace.
I think I understand. You see this exception in debugger display, but it is never caught and does not break the application, right?
Then it comes from the FtpClient.Dispose()
method, and you can safely ignore it.
Yeah, i see it in the console output of the program. Both in debug and release mode, but it does not break the application unless i configure to break on all exceptions in the exception settings.
So i guess its not really a problem but i wondered if it could be solved somehow. Thanks for your help either way! And sorry for my late response. You can close this if you want.
So i guess its not really a problem but i wondered if it could be solved somehow.
This is not a problem at all, it is a regular way to interrupt a thread 😉
Hello! Thank you for this FTP library. It seems well written and easy to use.
I have a c# program that occasionally retrieves a number of small files from another device using ftp. The program works, but an exception is thrown every time and does not get caught in my try catch block. "Exception thrown: 'System.Threading.ThreadInterruptedException' in mscorlib.dll" The exception does not cause the program to crash but i wonder why it is happening. Perhaps you can help?
Here is my code:
And here is the output of the program: File: 2016-12-20.csv does not exist locally. Downloading. File: 2016-12-21.csv does not exist locally. Downloading. File: 2016-12-22.csv does not exist locally. Downloading. Exception thrown: 'System.Threading.ThreadInterruptedException' in mscorlib.dll The thread 0x3920 has exited with code 0 (0x0). Exiting FTP function.
As you can see, the exception is thrown while inside my ftp function but seemingly on an other thread as it is not caught in my try-catch block. All files are succesfully downloaded and my function returns "true".