2009-11-01 118 views
2

我有一個WPF應用程序。它運行正常,但是當計算機進入「待機」模式時,它會崩潰,並出現未知的異常情況。 這可能與我的窗口是透明的事實有關。 我使用.NET 3.5 SP1。 有沒有人有想法?WPF應用程序在進入待機狀態時崩潰

編輯1: 當窗口處於visibility.Collapsed - 應用程序不會崩潰。 當窗口沒有透明度 - 它也不會崩潰。 這是堆棧跟蹤:

System.InvalidOperationException:呈現線程上發生未指定的錯誤。 System.Windows.Media.Media.Media.MediaContext.NotifyPartitionIsZombie(Int32 failureCode)在System.Windows.Media.MediaContext.NotifyChannelMessage()在System.Windows.Interop.HwndTarget.HandleMessage(Int32 msg,IntPtr wparam,IntPtr lparam)在System.Windows 。MS上的MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,布爾&已處理).Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,布爾&處理) .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,布爾isSingleParameter,委託catchHandler)在System.Windows.Threading.Dispatcher.WrappedInvoke(委託回調,對象args,布爾isSingleParameter,委託catchHa ndler)在System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority優先級,時間跨度超時,委託方法,對象args,布爾isSingleParameter)在System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority優先級,委託方法,對象arg)在MS .Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam)at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG & msg)at System.Windows在System.Windows.Threading.Dispatcher.Run()System.Windows.Application.RunDispatcher(對象忽略)上System.Windows.Application.RunInternal(窗口窗口)System.Windows上.Threading.Dispatcher.PushFrame(DispatcherFrame框架)在C:\ Documents and Settings \ Lehavi \ My Documents \ Working Version \ Widget \ obj \ Release \ App中的Widget.App.Main()處的System.Windows.Application.Run()處應用。運行(窗口窗口) g.cs:System.AppDomain._nExecuteAssemb處的第0行在System.Runtime.Host.Runtime.Hosting.ManifestRunner.Run(布爾checkAptModel)在System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly(System.AppDomain.nExecuteAssembly(Assembly assembly,String [] args) )在System.Activator.CreateInstance(ActivationContext activationContext)上的System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)上的System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext,String [] activationCustomData)上的Microsoft.VisualStudio.HostingProcess .HostProc.RunUsersAssemblyDebugInZone()在System.Threading.ThreadHelper.ThreadStart_Context(對象狀態)在System.Threading.ExecutionContext.Run(的ExecutionContext的ExecutionContext,ContextCallback回調,對象狀態)在System.Threading.ThreadHelper.ThreadStart()

+0

這是您以某種方式編寫或開發的應用程序嗎?如果是這樣,爲什麼你不能從異常中收集更多信息?如果不是,這個問題屬於SU。 – Jherico 2009-11-01 15:29:37

+0

你是否附加了調試器來查看它是否爲託管異常或獲取callstack? – bitbonk 2009-11-01 15:29:50

+0

你可以附上一個完整的堆棧跟蹤嗎?沒有猜測,任何人都不可能提供幫助。 – 2009-11-01 16:14:14

回答

1

如果這是一個違規行爲或類似的非託管異常,請嘗試禁用圖形卡驅動程序中的所有硬件加速並查看問題是否仍然存在。如果不是這是一個驅動程序問題。迄今爲止,WPF應用程序中唯一真正的非託管異常與可憐的驅動程序有關。