WPF应用程序在进入待机状态时崩溃
我有一个WPF应用程序。它运行正常,但当计算机进入“待机”模式时,会崩溃,出现未知异常 这可能与我的窗口是透明的有关。WPF应用程序在进入待机状态时崩溃,wpf,standby,Wpf,Standby,我有一个WPF应用程序。它运行正常,但当计算机进入“待机”模式时,会崩溃,出现未知异常 这可能与我的窗口是透明的有关。 我正在将.NET 3.5与SP1一起使用。 有人有主意吗 编辑1 当窗口处于可见性。折叠状态时-应用程序不会崩溃。 当窗口没有透明度时,它也不会崩溃 这是堆栈跟踪: System.InvalidOperationException: An unspecified error occurred on the render thread. at System.Windows.M
我正在将.NET 3.5与SP1一起使用。
有人有主意吗 编辑1 当窗口处于
可见性。折叠状态时
-应用程序不会崩溃。当窗口没有透明度时,它也不会崩溃 这是堆栈跟踪:
System.InvalidOperationException: An unspecified error occurred on the render thread.
at System.Windows.Media.MediaContext.NotifyPartitionIsZombie(Int32 failureCode)
at System.Windows.Media.MediaContext.NotifyChannelMessage()
at System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) 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()
at Widget.App.Main() in C:\Documents and Settings\Lehavi\My Documents\Working Version\Widget\obj\Release\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
如果是访问冲突或类似的非托管异常,请尝试禁用图形卡驱动程序中的所有硬件加速,并查看问题是否仍然存在。如果没有,则是驱动程序问题。到目前为止,我在WPF应用程序中看到的唯一真正的非托管异常与糟糕的驱动程序有关。这是您以某种方式编写或开发的应用程序吗?如果是这样,为什么不能从异常收集更多信息?如果不是,则此问题属于SU。是否已附加调试器以查看其是否为托管异常或获取调用堆栈?是否可以附加完整的堆栈跟踪?如果没有这些,任何人都不可能不加猜测就帮上忙。我添加了堆栈跟踪。问题是,异常发生在系统开始关闭之后,并且我的Visual Studio已经不处于活动状态。我设法用一个记录器得到了踪迹。