Silverlight 5 AccessViolationException

I installed Silverlight 5 VS 2010 tools and a 64-bit development environment for developers, and now I get a System.AccessViolationException when I perform a specific action. Projects are still Silverlight 4, I have not updated them. I checked on another developer's computer (which does not yet have SL5) that the same code still works in SL4. Message: {System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.} {System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.} And it kills IE. This happens after confirming the removal of the ChildWindow ok button, and my breakpoint does not fall into the action event ok (other confirmation confirmations that I have using the same code do not have this problem). 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 points to my own RadDateTimePicker 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 App.xaml and still get an exception ... This time it points to the Telerik theme "The debugger will ask the user to find the file: Telerik.Windows.Controls.Input;Component\Themes\Office\Black\DateTimePicker.xaml"

My colleague mentioned that he saw the same exception in Silverlight when he posted in some incorrect XAML XMLWriter.

I will add more information when I find it.

Does anyone know what to look for in this particular style file?

EDIT: I saw this now in several places, and not just related to DateTimePicker. I baptized this at http://forums.silverlight.net/p/245247/613094.aspx/1?p=True&t=634600762692144367 .

I also get this exception with this stack trace. This does not happen every time, but when I change the width of the rectangle using RadNumericUpDown, and 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: it looks like: http://forums.silverlight.net/p/178858/402638.aspx

EDIT No. 3: I could not reproduce this outside my project. I also did not stop this when commenting on UserControls and code sections. I even removed the binding from XAML and RadNumericUpDown, which I seem to be connected to. I have not deleted our custom styles yet, maybe try something further ... 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

+3
source share
5 answers

I finally figured out my specific problem. This only happened to the element after my inherited ChildWindow.

I had this hack that was trying to fix the error that I had several months ago. As soon as I deleted it, the exception ceased. I am pretty sure that I no longer need a hack, because there are improvements in other places, so this is a double bonus! I tried marching callbacks to the user interface thread in several places, but something in the timer (which is supposed to be in the user interface thread) did not allow this (this is my theory). Good luck to everyone who is looking for an answer. +1 for those who are still!

 this.Closed += (s, e) => { var timer = new System.Windows.Threading.DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(.25); timer.Tick += (object senderTimer, EventArgs eTimer) => { timer.Stop(); // without the timer, the content will disappear before the window closes this.contentHolder.Child = null; }; timer.Start(); }; 

I could not reproduce this with ChildWindow in a separate project. Therefore, this answer is not so useful.

0
source

I see this exception when binding data to a hidden element. We have some fields that are visible or not based on some data bindings, but both of these fields are updated using a different data binding. When RaisePropertyChanged is launched in a hidden field, we get an AccessViolationException. I had to add some checks to my code to suppress RaisePropertyChanged when the control is not displayed.

+3
source

We “experienced this problem” after upgrading to Silverlight 5. When installing (sender as RadComboBox), an AccessViolationException.ItemsSources exception was thrown during the loading event of various controls. This error was difficult to reproduce and did not always throw itself under the same test conditions. However, I believe that the best work is as follows:

Silverlight 4:

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

The problems disappeared when I added ...

Silverlight 5:

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

I am sure that at best it is a “work around” and we hope to hear a better solution. But while we work again!

+2
source

There is a Microsoft Connect error report tag for the same problem that we introduced a couple of hours ago. Please vote so that it can be fixed as soon as possible.

RadComboBox already contains a workaround, so please check the latest internal build in your account and let us know if the problem persists. Here is a Telerik forum topic about the same issue.

Hope this helps.

+1
source

I updated DateTimePicker.xaml for my custom theme to use the Microsofts or RadWatermarkText text box as my workaround. The crash stopped, but the watermark feature apparently disappeared.

I downloaded a theme project from Telerik about a year ago so that I can make their controls almost as good as the default ones. If any of you want to do the same as me, you will find DateTimePicker.xaml in their download.

I found that the Telerik controls are too coarse for my taste, so I don’t want to constantly pay them for fixing bugs through a subscription.

+1
source

Source: https://habr.com/ru/post/905200/


All Articles