Silverlight 5 AccessViolationException

后端 未结 5 1950
别跟我提以往
别跟我提以往 2021-01-20 22:11

I installed the Silverlight 5 VS 2010 tools and the 64-bit Developer runtime and now I get a System.AccessViolationException when I do a specific action. The projects are st

5条回答
  •  生来不讨喜
    2021-01-20 22:21

    We "were" experiencing this problem after updating to Silverlight 5. The AccessViolationException was being thrown when setting (sender as RadComboBox).ItemsSources during the loading event of various controls. This error was difficult to reproduce and did not always throw under identical test conditions. However, I believe the best work around is as follows:

    Silverlight 4:

    (sender as RadComboBox).ItemsSource = OurClass.MakeOurList();
    

    The issues disappeared when I added...

    Silverlight 5:

    (sender as RadComboBox).UpdateLayout();
    
    (sender as RadComboBox).ItemsSource = OurClass.MakeOurList();
    

    I am sure this is a "work around" at best, and hope to hear a better solution. But for now we are back up and running!

提交回复
热议问题