StackOverflow の誰かが次の問題を解決してくれることを願っています。
VS2012 を使用して開く WP7.1 プロジェクトがあります。また、共通言語ランタイム例外を有効にしました。これを行うことで、コード内にある可能性のあるほとんどのバグを見つけて修正したいと考えました。
エミュレーターでプロジェクトを実行すると、次の例外が発生します。
System.Reflection.TargetInvocationException occurred
Message=TargetInvocationException
StackTrace:
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.RuntimePropertyInfo.InternalGetValue(PropertyInfo thisProperty, Object obj, Object[] index, StackCrawlMark& stackMark)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at System.Windows.CLRPropertyListener.get_Value()
at System.Windows.PropertyAccessPathStep.ConnectToPropertyInSource(Boolean isSourceCollectionViewCurrentItem)
at System.Windows.PropertyAccessPathStep.ConnectToProperty()
at System.Windows.PropertyAccessPathStep.ReConnect(Object newSource)
at System.Windows.PropertyPathListener.ReConnect(Object source)
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.TargetLoaded(Object o, RoutedEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
InnerException: System.InvalidOperationException
Message=InvalidOperationException
StackTrace:
at System.Windows.Duration.get_TimeSpan()
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.RuntimePropertyInfo.InternalGetValue(PropertyInfo thisProperty, Object obj, Object[] index, StackCrawlMark& stackMark)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at System.Windows.CLRPropertyListener.get_Value()
at System.Windows.PropertyAccessPathStep.ConnectToPropertyInSource(Boolean isSourceCollectionViewCurrentItem)
at System.Windows.PropertyAccessPathStep.ConnectToProperty()
at System.Windows.PropertyAccessPathStep.ReConnect(Object newSource)
at System.Windows.PropertyPathListener.ReConnect(Object source)
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.TargetLoaded(Object o, RoutedEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
と
System.InvalidOperationException occurred
Message=InvalidOperationException
StackTrace:
at System.Windows.Duration.get_TimeSpan()
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.RuntimePropertyInfo.InternalGetValue(PropertyInfo thisProperty, Object obj, Object[] index, StackCrawlMark& stackMark)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at System.Windows.CLRPropertyListener.get_Value()
at System.Windows.PropertyAccessPathStep.ConnectToPropertyInSource(Boolean isSourceCollectionViewCurrentItem)
at System.Windows.PropertyAccessPathStep.ConnectToProperty()
at System.Windows.PropertyAccessPathStep.ReConnect(Object newSource)
at System.Windows.PropertyPathListener.ReConnect(Object source)
at System.Windows.Data.BindingExpression.SourceAcquired()
at System.Windows.Data.BindingExpression.TargetLoaded(Object o, RoutedEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex,
String eventName)
明らかに、両方の例外がリンクされています。これらの例外は次々にスローされ、同じ内部例外が含まれているためです。
これらの例外がスローされるページでは、WPToolkit といくつかのカスタム コントロールを使用します。LoopingSelector だけが Duration 構造を使用します。しかし、私は LoopingSelector のコードに問題はないと思います。
誰かがバグを探すためにどの方向を指し示すことができますか? XAML バインディング? 鋳造?