No line numbers in release stack trace
-
Hi, I'm looking into a problem on our website but other than the method I have no way of knowing which control/line number the error refers to. I know it is caused by one of 4 controls where we convert the contents to an int. For example, the code is: private void SomeMethod() { int i = Convert.ToInt32(ddl.SelectedValue); int i2 = Convert.ToInt32(txt.Text); } I think it is being caused by a custom textbox's value returning null. It is an intermittent problem and not something we have been able to recreate. The stack trace is: Input string was not in a correct format System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 System.Convert.ToInt32(String value) +63 It would be nice to narrow the search down to a particular control and I would like to understand how exactly I can narrow the stack trace error down to a particular line. Can anybody please tell me how this is possible? Thanks
-
Hi, I'm looking into a problem on our website but other than the method I have no way of knowing which control/line number the error refers to. I know it is caused by one of 4 controls where we convert the contents to an int. For example, the code is: private void SomeMethod() { int i = Convert.ToInt32(ddl.SelectedValue); int i2 = Convert.ToInt32(txt.Text); } I think it is being caused by a custom textbox's value returning null. It is an intermittent problem and not something we have been able to recreate. The stack trace is: Input string was not in a correct format System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +119 System.Convert.ToInt32(String value) +63 It would be nice to narrow the search down to a particular control and I would like to understand how exactly I can narrow the stack trace error down to a particular line. Can anybody please tell me how this is possible? Thanks
Check which of the lines is returning String.Empty (i.e empty string) as the parameter to Convert.ToInt32() function. Convert.ToInt32(null) will return 0 whereas Convert.ToInt32("") - throws the exception is mentioned. I hope this would help you.
Castle Rider
What if I freeze??? Don't forget to breath...
My: Website | Yahoo Group | Blog Spot