Skip to main content

Microsoft Silverlight

Unanswered Question RC0 - How can I find location of Sys.InvalidOperationException ?RSS Feed

(0)

dbaechtel
dbaechtel

Member

Member

59 points

207 Posts

RC0 - How can I find location of Sys.InvalidOperationException ?

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.

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Re: RC0 - How can I find location of Sys.InvalidOperationException ?

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... 

Mark as answer if this post answered your question.

Harsh Bardhan

dbaechtel
dbaechtel

Member

Member

59 points

207 Posts

Re: RC0 - How can I find location of Sys.InvalidOperationException ?

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 Shen – MSFT
Jonathan...

All-Star

All-Star

24979 points

2,434 Posts

Microsoft

Re: RC0 - How can I find location of Sys.InvalidOperationException ?

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

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

dbaechtel
dbaechtel

Member

Member

59 points

207 Posts

Re: RC0 - How can I find location of Sys.InvalidOperationException ?

Jonathan Shen – MSFT:

 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.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24979 points

2,434 Posts

Microsoft

Re: RC0 - How can I find location of Sys.InvalidOperationException ?

Hi Dbaechtel,

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.

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Jonathan Shen – MSFT
Jonathan...

All-Star

All-Star

24979 points

2,434 Posts

Microsoft

Re: RC0 - How can I find location of Sys.InvalidOperationException ?


Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

dbaechtel
dbaechtel

Member

Member

59 points

207 Posts

Re: RC0 - How can I find location of Sys.InvalidOperationException ?

No one as yet has attempted to answer the questions that I put in my original post.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities