进入待机状态时WPF应用程序崩溃

时间:2009-11-01 15:17:55

标签: wpf standby

我有一个WPF应用程序。它运行正常,但当计算机进入“待机”模式时,它会崩溃,但有一个未知的异常。 这可能与我的窗口是透明的事实有关。 我使用.NET 3.5 SP1。 有没有人有想法?

编辑1:  当窗口处于可见性时。收到 - 应用程序不会崩溃。  当窗口没有透明度时 - 它也不会崩溃。 这是堆栈跟踪:

System.InvalidOperationException:渲染线程上发生了未指定的错误。在System.Windows.Media.MediaContext.NotifyPartitionIsZombie(的Int32失败代码)在System.Windows.Media.MediaContext.NotifyChannelMessage()在System.Windows.Interop.HwndTarget.HandleMessage(MSG的Int32,IntPtr的WPARAM,IntPtr的LPARAM)在System.Windows在MS的MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean& handling)的.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean& handling) .Win32.HwndSubclass.DispatcherCallbackOperation(对象O)在System.Windows.Threading.ExceptionWrapper.InternalRealCall(代表回调,对象指定参数时,布尔isSingleParameter)在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源,代表回调,对象指定参数时, System.Windows.Threading.Dispatcher.InvokeImpl上的System.Windows.Threading.Dispatcher.WrappedInvoke(委托回调,Object args,Boolean isSingleParameter,Delegate catchHandler)中的Boolean isSingleParameter,Delegate catchHandler) (优先的DispatcherPriority,时间跨度超时,委托方法,对象指定参数时,布尔isSingleParameter)在System.Windows.Threading.Dispatcher.Invoke(的DispatcherPriority优先权,委托方法,对象ARG)在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr的HWND,MSG的Int32 ,IntPtr wParam,IntPtr lParam)在MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& MSG)在System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame帧)在System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame帧)在System.Windows.Threading.Dispatcher.Run()在System.Windows.Application.RunDispatcher System.Windows.Application.Run(窗口窗口)的System.Windows.Application.RunInternal(窗口窗口)中的System.Windows.Application.Run()位于C:\的Widget.App.Main()中的(Object ignore)文档和设置\ Lehavi \ My Documents \ Working Version \ Widget \ obj \ Release \ App.g.cs:System.AppDomain.nExecuteAssembly上的System.AppDomain._nExecuteAssembly(Assembly assembly,String [] args)中的第0行(程序集程序集) ,字串[] args)在System.Runtime.Hosting.ManifestRunner.Run(布尔checkAptModel)在System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()在System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext,字符串[] activationCustomData )在System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContex)吨activationContext)在System.Activator.CreateInstance(ActivationContext activationContext)在Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()在System.Threading.ThreadHelper.ThreadStart_Context(对象状态)在System.Threading.ExecutionContext.Run(的ExecutionContext的ExecutionContext,ContextCallback System.Threading.ThreadHelper.ThreadStart()

中的回调,对象状态

1 个答案:

答案 0 :(得分:1)

如果是违规或类似的非托管异常,请尝试禁用显卡驱动程序中的所有硬件加速,并查看问题是否仍然存在。如果不是,则是驱动程序问题。到目前为止,我在WPF应用程序中看到的唯一真正的非托管异常与糟糕的驱动程序有关。

相关问题