Is there way to get to the code line which is throwing Arithmetic Exception like Infinity and NaN in VB.net
Clash Royale CLAN TAG#URR8PPP
Is there way to get to the code line which is throwing Arithmetic Exception like Infinity and NaN in VB.net
Is there anything to find in visual studio 2010, vb.net to find where Infinity and NaN are being thrown. I am looking into code by others and there is number of lines of codes and loop is long to track where Infinity and NaN exists since there exists lots of loop inside a single function.
I tried Debug->Exceptions->Common Language Runtime Exceptions=>System=>System.ArithmeticException and checking Thrown
This do not break the execution.
2 Answers
2
You can add a condition to a debug breakpoint, such as a check for Double.IsPositiveInfinity(x).
Set a breakpoint. Right-click it and choose "Conditions..." and set an appropriate condition.
More information: How to: Specify a Breakpoint Condition.
So one way I use to locate sometimes an error is to use debug.print() statements. So debug.print("1") and than some code and than debug.print("2"). I the second one doesn't print you know the error is in between the two debugs.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Those mishaps do not cause an exception. So no, you have to single-step the code to see it go wrong. Focus on getting good test data so you can consistently repro the problem and setting the right breakpoint so you don't have to step too much.
– Hans Passant
Aug 12 at 9:35