I have a C # (.NET 4.0) program, whose main is calling methods from an external FTP library - a dll Project reference. The logic is in a try-blocking block, and the capture marks the error. The exception handler has the normal parameter: Sometimes the FTP library throws the lower division with zero divisions. The problem is that not caught and caught in the catch block crashes. Exceptions generated in my cover code have been caught. Anyone have any idea what the difference is and how an exception can be caught Exception: hold (exception before)
. IDE VS is.
Description: The process was terminated due to an exception without verb . Exception information: System.DivideByZeroException Stack: System.read.ExecutionContext.RunTryCode (System.Object) on System.Runtime.CompliersServices.Respectifiers.xActed with Guaranteed Cleanup (TryCode, CleanupCode, System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext.Run on System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) (System.Threading.ExecutionContext, System.Threading.ContextCallback (Object), System.Object) on System.Threading.ThreadHelper.ThreadStart ()
Is not the problem of similar problem Not even for clarification. As stated in a comment that an FTP server should be violating the protocol despite crashing. If you can, then you should choose another FTP. However, if you want to use that domain, then you have to handle the exception at the App Domain level according to BloggerBird.
Here's an example of an exception using this event:
using the system; Using System.Security.Permissions; Public class test {[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlAppDomain)] public static void example () {AppDomain currentDomain = AppDomain.CurrentDomain; CurrentDomain.UnhandledException + = New Unfaced Expression Handler (MyHandler); Try {new exception ("1"); } Hold (Exception e) {Console.WriteLine ("Catch Claws Caught:" + e.Message); } Throw a new exception ("2"); // Output: // Catching section caught: 1 // MyHandler caught: 2} static void MyHandler (object sender, UnhandledExceptionEventArgs args) {exception e = (exception) args.exceptionObject; Console.lightline ("caught masturbator:" + e.message); } Public static zero major () {example (; }}
No comments:
Post a Comment