Silverlight 引发ErrorsAnged事件时INotifyDataErrorInfo ArgumentOutOfRangeException
这是一个非常复杂的问题,在这一点上,我认为这可能与我的机器配置有关 基本上,我已经创建了一个非常标准的Silverlight 引发ErrorsAnged事件时INotifyDataErrorInfo ArgumentOutOfRangeException,silverlight,validation,silverlight-4.0,inotifydataerrorinfo,Silverlight,Validation,Silverlight 4.0,Inotifydataerrorinfo,这是一个非常复杂的问题,在这一点上,我认为这可能与我的机器配置有关 基本上,我已经创建了一个非常标准的INotifyDataErrorInfo实现,在某些情况下,当引发ErrorsChanged事件时,我会得到一个ArgumentOutOfRangeException。此异常不包含太多信息;它为我提供了跨越本机/托管边界的ArgumentOutOfRangeException以及关于非负索引和集合大小的标准ArgumentOutOfRangeException说明。InnerException为
INotifyDataErrorInfo
实现,在某些情况下,当引发ErrorsChanged
事件时,我会得到一个ArgumentOutOfRangeException
。此异常不包含太多信息;它为我提供了跨越本机/托管边界的ArgumentOutOfRangeException
以及关于非负索引和集合大小的标准ArgumentOutOfRangeException
说明。InnerException
为空。堆栈跟踪如下所示:
at System.ThrowHelper
.ThrowArgumentOutOfRangeException(ExceptionArgument argument,
ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
at System.Collections.ObjectModel.ReadOnlyCollection`1.get_Item(Int32 index)
我之所以提到我的机器配置,是因为我尝试了一些发布到博客上的解决方案(如和),但遇到了相同的问题(即不是我的代码,是INotifyDataErrorInfo的另一个实现),而在任何其他人的评论中都没有提到我遇到的问题。谷歌搜索发现了一些随机的点击,但没有帮助
要求的国家如下:
at System.ThrowHelper
.ThrowArgumentOutOfRangeException(ExceptionArgument argument,
ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
at System.Collections.ObjectModel.ReadOnlyCollection`1.get_Item(Int32 index)
mscorlib.dll!System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument argument, System.ExceptionResource resource) + 0x40 bytes
mscorlib.dll!System.ThrowHelper.ThrowArgumentOutOfRangeException() + 0x10 bytes
mscorlib.dll!System.Collections.Generic.List<System.Windows.Controls.ValidationError>.this[int].get(int index = 0) + 0x13 bytes
mscorlib.dll!System.Collections.ObjectModel.Collection<System.Windows.Controls.ValidationError>.this[int].get(int index) + 0x2e bytes
mscorlib.dll!System.Collections.ObjectModel.ReadOnlyCollection<System.Windows.Controls.ValidationError>.this[int].get(int index) + 0x2e bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.dll!System.Windows.IndexerListener.Value.get() + 0xc3 bytes
System.Windows.dll!System.Windows.IndexerPathStep.Value.get() + 0x17 bytes
System.Windows.dll!System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(System.Windows.PropertyPathStep source = {System.Windows.IndexerPathStep}) + 0x17 bytes
System.Windows.dll!System.Windows.IndexerPathStep.RaisePropertyPathStepChanged(System.Windows.PropertyListener source) + 0xe bytes
System.Windows.dll!System.Windows.IndexerListener.SourcePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs args) + 0xea bytes
System.Windows.dll!System.Windows.Data.WeakPropertyChangedListener.PropertyChangedCallback(object sender, System.ComponentModel.PropertyChangedEventArgs args) + 0x3d bytes
System.Windows.dll!System.Collections.ObjectModel.ReadOnlyObservableCollection<System.__Canon>.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs args) + 0x17 bytes
System.Windows.dll!System.Collections.ObjectModel.ReadOnlyObservableCollection<System.__Canon>.HandlePropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + 0xe bytes
System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<System.Windows.Controls.ValidationError>.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e) + 0x37 bytes
System.Windows.dll!System.Collections.ObjectModel.ObservableCollection<System.Windows.Controls.ValidationError>.RemoveItem(int index = 0) + 0x79 bytes
mscorlib.dll!System.Collections.ObjectModel.Collection<System.Windows.Controls.ValidationError>.Remove(System.Windows.Controls.ValidationError item) + 0x75 bytes
System.Windows.dll!System.Windows.Controls.Validation.RemoveValidationError(System.Windows.FrameworkElement fe = {System.Windows.Controls.TextBox}, System.Windows.Controls.ValidationError error) + 0x40 bytes
System.Windows.dll!System.Windows.Data.BindingExpression.RemoveErrorFromTarget(System.Windows.Controls.ValidationError error) + 0x48 bytes
System.Windows.dll!System.Windows.Data.BindingExpression.NotifyOldDataErrorInfos(System.Collections.ObjectModel.Collection<System.Windows.Controls.ValidationError> validationErrors) + 0x73 bytes
System.Windows.dll!System.Windows.Data.BindingExpression.NotifyOldDataErrorInfos(bool isNotifyChildDataErrorInfo) + 0x25 bytes
System.Windows.dll!System.Windows.Data.BindingExpression.NotifyDataErrorInfo_ErrorsChanged(object sender, System.ComponentModel.DataErrorsChangedEventArgs e) + 0xad bytes
mscorlib.dll!System.ThrowHelper.throwargumentofrangeexception(System.exception参数,System.exception资源)+0x40字节
mscorlib.dll!System.ThrowHelper.ThrowArgumentOutOfRangeException()+0x10字节
mscorlib.dll!System.Collections.Generic.List.this[int].get(int index=0)+0x13字节
mscorlib.dll!System.Collections.ObjectModel.Collection.this[int].get(int索引)+0x2e字节
mscorlib.dll!System.Collections.ObjectModel.ReadOnlyCollection.this[int].get(int索引)+0x2e字节
[本机到托管转换]
[管理到本机转换]
System.Windows.dll!System.Windows.IndexerListener.Value.get()+0xc3字节
System.Windows.dll!System.Windows.IndexerPathStep.Value.get()+0x17字节
System.Windows.dll!System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(System.Windows.PropertyPathStep源={System.Windows.IndexerPathStep})+0x17字节
System.Windows.dll!System.Windows.IndexerPathStep.RaisePropertyPathStepChanged(System.Windows.PropertyListener源)+0xe字节
System.Windows.dll!System.Windows.IndexerListener.SourcePropertyChanged(对象发送方,System.ComponentModel.PropertyChangedEventArgs)+0xea字节
System.Windows.dll!System.Windows.Data.WeakPropertyChangedListener.PropertyChangedCallback(对象发送方,System.ComponentModel.PropertyChangedEventArgs参数)+0x3d字节
System.Windows.dll!System.Collections.ObjectModel.ReadOnlyObservableCollection.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs)+0x17字节
System.Windows.dll!System.Collections.ObjectModel.ReadOnlyObservableCollection.HandlePropertyChanged(对象发送方,System.ComponentModel.PropertyChangedEventArgs e)+0xe字节
System.Windows.dll!System.Collections.ObjectModel.ObservableCollection.OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e)+0x37字节
System.Windows.dll!System.Collections.ObjectModel.ObservableCollection.RemoveItem(int index=0)+0x79字节
mscorlib.dll!System.Collections.ObjectModel.Collection.Remove(System.Windows.Controls.ValidationError项)+0x75字节
System.Windows.dll!System.Windows.Controls.Validation.RemoveValidationError(System.Windows.FrameworkElement fe={System.Windows.Controls.TextBox},System.Windows.Controls.ValidationError)+0x40字节
System.Windows.dll!System.Windows.Data.BindingExpression.RemoveErrorFromTarget(System.Windows.Controls.ValidationError错误)+0x48字节
System.Windows.dll!System.Windows.Data.BindingExpression.NotifyOldDataErrorInfos(System.Collections.ObjectModel.Collection validationErrors)+0x73字节
System.Windows.dll!System.Windows.Data.BindingExpression.NotifyOldDataErrorInfos(bool isNotifyChildDataErrorInfo)+0x25字节
System.Windows.dll!System.Windows.Data.BindingExpression.NotifyDataErrorInfo\u ErrorsAnged(对象发送方,System.ComponentModel.DataErrorsAngedEventArgs e)+0xad字节
更新:应用程序(在有问题的机器上)运行良好,没有附加调试程序,工作正常,没有调用未处理的异常脚本(这有点难倒我了,不是吗