Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit RC0 - How can I find location of Sys.InvalidOperationException ?
7 replies. Latest Post by dbaechtel on December 18, 2008.
(0)
dbaechtel
Member
59 points
207 Posts
10-01-2008 12:42 PM |
I have a SL2RC0 application that I am debugging in VSTS 2008 and it is getting a Sys.InvalidOperationException "value does not fall within expected range" error and triggering the Microsoft Script Debugger to come up. The MS Script Debugger does not show me much of a stack trace, but the message property in the exception shows quite a stack trace.
Apparently the error is coming from a ListBox.OnSelectionChanged that was triggered by a ListBoxItem.OnMouseLeftButtonDown. But without an active stacktrace in the MS Script Debuuger I can not look at any of the details of the calls to try an determine which list box in my application might be causing the exception.
How do I find out what is causing this exception?How do I find out which ListBox is creating this exception?How do I get this exception to trigger the debugger in VSTS 2008 instead of a runtime debugger?
THANKS for your help.
HarshBar...
Star
9908 points
1,719 Posts
10-02-2008 6:59 AM |
Hi,
what Code are you writing in your Selection changed event.
I normally found this error occurs when you are adding a object from one collection into some other collection means we want that object into two collection.
So instead of this we can create a new object and copy properties from existing object...
10-02-2008 8:45 AM |
HarshBardhan: Hi, what Code are you writing in your Selection changed event.
I don't have any code in any Selection changed event. The Selection changed event seemed to be triggered automatically by the MouseLeftButtonDown on the ListBox, but the Selection changed event runs after I remove the ListBox in the MouseLeftButtonDown event handler. I think that whatever the system is doing in the Selection changed event should be done before the MouseLeftButtonDown event handler is invoked, or it should silently abort if the ListBox is Removed and not thow an exception.
Jonathan...
All-Star
24646 points
2,418 Posts
10-03-2008 3:22 AM |
Hi Dbaechtel,
Sys.InvalidOperationException is usually raised by being given not invalid arguments. Debugging techniques is a big topic, which has tons of books been published. Here, would you please provide a tiny repro to make the discussion much easier to be performed ? Thanks for understanding.
Best regards,
Jonathan
10-03-2008 8:37 AM |
Jonathan Shen – MSFT: Here, would you please provide a tiny repro to make the discussion much easier to be performed ? Thanks for understanding.
Here, would you please provide a tiny repro to make the discussion much easier to be performed ? Thanks for understanding.
These Silverlight.Net forums do not provide any mechanism to provide a repro project. If they are so dependant on repro projects in order to assist, then they should provide some mechanism to attach significant amounts of code. The Silverlight group is only doing itself a disservice when they make it more difficult to find and fix these problems before the formal release.
10-04-2008 8:03 AM |
Yes. Currently, Silverlight.net is the only entrance to feedback. However, you can paste your code or upload to somewhere and give us the link. Thanks.
12-17-2008 10:28 PM |
12-18-2008 9:32 AM |
No one as yet has attempted to answer the questions that I put in my original post.