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 still Silverlight 4, I haven’t upgraded them. I verified on another developer’s computer (who doesn’t have SL5 installed yet) that the same code still works in SL4.
The message is:{System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.} and it kills IE.
It’s happening after a delete confirmation ChildWindow’s ok button is clicked and my breakpoint in the ok action event is not hit (the other delete confirmations I have, using the similar code do not have this problem).
The stack trace points to
System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase obj = {Telerik.Windows.Controls.RadWatermarkTextBox}, System.Windows.DependencyProperty property, string s) + 0x6f bytes
VS is pointing to my RadDateTimePicker custom style: "BindingDebugging!RadDateTimePickerxaml_2.BindingOperation_1100_562(object BindingState = {System.Windows.Data.Debugging.BindingDebugState}) Line 1 + 0x11 bytes Unknown"
I removed the style from the controls and the App.xaml and still get an exception… This time it points to a Telerik theme "The debugger will ask the user to find the file: Telerik.Windows.Controls.Input;Component\Themes\Office\Black\DateTimePicker.xaml"
My coworker mentioned that he saw the same exception in Silverlight when he sent in some malformed XAML to an XMLWriter.
I’ll add more information as I find it.
Anybody know what to look for specifically in that style file?
EDIT: I’ve seen this in a few places now, not just connected to the DateTimePicker. I cross posted this at http://forums.silverlight.net/p/245247/613094.aspx/1?p=True&t=634600762692144367.
I also get this exception with this stack trace. It doesn’t happen every time, but it is when I’m changing the width of a rectangle using a RadNumericUpDown and the RaisePropertyChanged(“Width”) is called: >
System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase obj = {Telerik.Windows.Controls.PickerTextBox}, System.Windows.DependencyProperty property, string s) + 0x6f bytes
System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase doh, System.Windows.DependencyProperty property, object obj) + 0x2ce bytes
System.Windows.dll!System.Windows.DependencyObject.SetObjectValueToCore(System.Windows.DependencyProperty dp, object value) + 0xd6 bytes
System.Windows.dll!System.Windows.DependencyObject.SetEffectiveValue(System.Windows.DependencyProperty property = {System.Windows.CoreDependencyProperty}, ref System.Windows.EffectiveValueEntry newEntry = {System.Windows.EffectiveValueEntry}, object newValue = "103") + 0x35 bytes
System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property = {System.Windows.CoreDependencyProperty}, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation operation) + 0xe6 bytes
System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value, bool allowReadOnlySet, bool isBindingInStyleSetter) + 0x248 bytes
System.Windows.dll!System.Windows.Controls.TextBox.Text.set(string value) + 0x33 bytes
Telerik.Windows.Controls.Input!Telerik.Windows.Controls.RadNumericUpDown.UpdateText() + 0x50 bytes
Telerik.Windows.Controls.Input!Telerik.Windows.Controls.RadNumericUpDown.OnValueChanged(Telerik.Windows.Controls.RadRangeBaseValueChangedEventArgs e = {Telerik.Windows.Controls.RadRangeBaseValueChangedEventArgs}) + 0xd6 bytes
EDIT #2:
this seems related: http://forums.silverlight.net/p/178858/402638.aspx
EDIT #3:
I have not been able to reproduce this outside of my project. I also haven’t stopped this from happening by commenting out UserControls and sections of code. I’ve even removed the binding from the XAML and the RadNumericUpDown that it seems to be connected to. I haven’t removed our custom styles yet, maybe that’s something to try next… Does anyone know how I can reproduce this and work from there?
EDIT #4: They fixed it with the latest version according to: http://10rem.net/blog/2012/05/09/silverlight-51104110-released-today
I finally tracked down my specific problem. It was only happening with an element after my inherited ChildWindow.
I had this hack that was trying to fix a bug I had a few months ago. Once I removed it, the exception stopped happening. I’m pretty certain I don’t need the hack anymore because of improvements elsewhere, so it’s a double bonus! I tried in several places to marshal the calls back to the UI thread, but something in the timer (which is supposed to be on the UI thread) was not allowing it (that’s my theory). Good luck to everyone looking for the answer. +1 for the ones so far!
I wasn’t able to reproduce this with a ChildWindow in a separate project. So this answer isn’t that useful.