【问题标题】:An unspecified error occurred on the render thread. (NotifyPartitionIsZombie)渲染线程上发生了未指定的错误。 (NotifyPartitionIsZombie)
【发布时间】:2011-02-06 03:52:06
【问题描述】:

好的,问题来了, 我有一个来自thriple 的 ContentControl3D 对象 在我创建一个带有图像的 LibraryStack 时,它运行良好,直到我运行创建和填充 LibraryStack 的函数。当我点击里面的任何对象时,我得到以下错误

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 WelkoMap.App.Main() in F:\MediaGarde\Surface\Development\WelkoMap\WelkoMap\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

这是添加和创建 LibraryStack 并填充它的代码

public void ReplaceBackContent(List<Image> images, List<MediaElement> videos)
{
    ContentControl3D control = this.TryFindParent<ContentControl3D>();
    if (control == null)
    {
        return;
    }
    LibraryStack stack = new LibraryStack();

    foreach (Image image in images)
    {
        if (image.Parent != null)
        {
            continue;
        }
        LibraryStackItem item = new LibraryStackItem();
        item.Content = image;
        stack.Items.Add(item);

    }
    control.BackContent = stack;
}

由于它有 NotifyPartitionIsZombie 错误,我已经安装了 Windows 更新 KB967634,它完全没有任何效果

【问题讨论】:

    标签: c# wpf multithreading render


    【解决方案1】:

    我讨厌这个例外!我也在调查它,并认为我会发布我发现的内容。

    • 您的显卡驱动程序是最新的吗?
    • 我还会使用 snoop 并检查其中一个对象并检查 NAN 的高度、宽度或位置。
    • 确保Window.AllowsTransparency Property 为假

    msdn 上有一篇帖子声称 WinDbg 内存转储可以帮助 Microsoft 进行调查。

    我希望这里有帮助。

    【讨论】:

      【解决方案2】:

      Here 是关于此错误的详细说明以及您可以采取的措施。

      【讨论】:

      • 您的链接现在好像坏了。
      【解决方案3】:

      我知道这是一个旧线程,但我注意到的一些 PC 上仍然出现异常。

      除了确保您的图形驱动程序是最新的之外,当我将硬件加速更改为最低级别(特别是使用 Matrox 卡)时,它也对我有所帮助。

      (在Win7上):右键单击>个性化>显示>更改显示设置>高级设置>疑难解答>更改设置

      我同意大卫的观点,这是一个可怕的例外!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-03-22
        • 1970-01-01
        • 2012-06-21
        • 2019-07-23
        • 1970-01-01
        • 1970-01-01
        • 2019-10-05
        • 2012-07-09
        相关资源
        最近更新 更多