ItemAutomationPeerクラスのGetNameCore()機能から明らかに発生した奇妙なNullReferenceExceptionと戦っています。PresentationFramework.dllからのNullReferenceException
例外の詳細は以下のとおりですが、本当に興味深い点は、Windows 7を実行している開発マシンやテストした他のWindows 7コンピュータでは発生しないということです。私のWindows 8 Proテストマシンでのみ発生します。
WPF DataGridコントロールでセルを編集しようとすると、例外がスローされます。
私は一日中それを成功させることなく追跡しようとしてきました。 Visual Studioを使用してプロセスをリモートでデバッグしようとしましたが、コードをステップ実行しても例外はありません。これは明らかにPresentationFramework.Dll内の一連のイベントによって実行され、例外はAppDomainを突破し、最終的にアプリケーションをクラッシュさせます。
誰かがこれを引き起こしている可能性のあること、またはそれを修正する方法を考えることができれば、本当に助けになるでしょう。オンライン
リモートデバッガとの往復の多くの後Exception Type: System.NullReferenceException
Exception Message: Object reference not set to an instance of an object.
Method Information: System.String GetNameCore()
Exception Source: PresentationFramework
Stack Trace
at System.Windows.Automation.Peers.ItemAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
Windows-8マシンですか?またはそれはW7で構築され、Windows-8から実行されただけですか?2つのOS間でdllの間にかなりの不一致があったと思って、W7マシンからビルドされたWindows-8で動作するようにローカルでコピーするための参照が必要でした。 Windows-8からビルドし、問題が引き続き発生するかどうか確認してください。コンパイルエラーが表示されるか、完了したらinnerExceptionの詳細が表示され、どのDLLがAero2などのAeroのようなものかを示している可能性があります。 – Viv
これは興味深い考えです。私はVSとのWindows 8のマシンを持っていないので、私は今仮説をテストすることはできません..しかし、あなたは少し異なっているフレームワークに関する何かになるかもしれません。 –