Silverlight 5 AccessViolationException

2023-12-04

我安装了 Silverlight 5 VS 2010 工具和 64 位开发人员运行时,现在当我执行特定操作时,我收到 System.AccessViolationException。这些项目仍然是Silverlight 4,我还没有升级它们。我在另一位开发人员的计算机(尚未安装 SL5)上验证了相同的代码在 SL4 中仍然有效。 消息是:{System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.}它会杀死 IE。 这是在单击删除确认 ChildWindow 的 ok 按钮并且未命中 ok 操作事件中的断点后发生的(我使用类似代码的其他删除确认没有此问题)。 堆栈跟踪指向

System.Windows.dll!MS.Internal.XcpImports.SetValue(MS.Internal.IManagedPeerBase obj = {Telerik.Windows.Controls.RadWatermarkTextBox}, System.Windows.DependencyProperty property, string s) + 0x6f bytes    

VS 指向我的 RadDateTimePicker 自定义样式:"BindingDebugging!RadDateTimePickerxaml_2.BindingOperation_1100_562(object BindingState = {System.Windows.Data.Debugging.BindingDebugState}) Line 1 + 0x11 bytes Unknown"

我从控件和 App.xaml 中删除了样式,但仍然出现异常...这次它指向 Telerik 主题"The debugger will ask the user to find the file: Telerik.Windows.Controls.Input;Component\Themes\Office\Black\DateTimePicker.xaml"

我的同事提到,当他向 XMLWriter 发送一些格式错误的 XAML 时,他在 Silverlight 中看到了同样的异常。

我会在找到更多信息时添加它。

有人知道在该样式文件中具体要寻找什么吗?

编辑:我现在在一些地方看到了这一点,而不仅仅是连接到 DateTimePicker。我交叉发布了这个.

我也通过这个堆栈跟踪得到了这个异常。它不会每次都会发生,但当我使用 RadNumericUpDown 更改矩形的宽度并调用 RaisePropertyChanged("Width") 时:>

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   

编辑#2: 这似乎相关:http://forums.silverlight.net/p/178858/402638.aspx

编辑#3: 我无法在我的项目之外重现这一点。我也没有通过注释掉用户控件和代码段来阻止这种情况的发生。我什至从 XAML 和它似乎连接到的 RadNumericUpDown 中删除了绑定。我还没有删除我们的自定义样式,也许下一步要尝试......有谁知道我如何重现这个并从那里开始工作?

编辑#4:他们根据以下内容使用最新版本修复了它:http://10rem.net/blog/2012/05/09/silverlight-51104110-released-today


当数据绑定到隐藏元素时,我看到了此异常。我们有一些可见或不基于某些数据绑定的字段,但这两个字段都使用另一个数据绑定进行更新。当在隐藏字段上触发 RaisePropertyChanged 时,我们会得到 AccessViolationException。我必须在代码中添加一些检查,以在控件不可见时抑制 RaisePropertyChanged。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Silverlight 5 AccessViolationException 的相关文章

随机推荐