我安装了 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。我在http://forums.silverlight.net/p/245247/613094.aspx/1?p=True&t=634600762692144367交叉发布了这个。
我也通过这个堆栈跟踪得到了这个异常。它不会每次都发生,但是当我使用 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