WPF Application Shutdown: An unspecified error occurred on the render thread.
- I have recently released my first WPF application, MuvUnder Cover: The Album Art Sleuth. During the beta testing period I had the program run on about 20 different hardware configurations without issue. Now, with the release, the software is crashing to the desktop on a lot of user machines when they are navigating in different areas of the interface. The application is built against .NET 3.5 and the installer installs .NET 3.5 if the user does not have it.
The error is as follows:
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 least one user that had the issue on Vista has had luck resolving the issue by installing the DirectX End-User Runtime Web Installer, as mentioned at http://forums.msdn.microsoft.com/en-US/wpf/thread/446f5f1c-4a0b-4479-b4ac-605d3c96d90b. The DirectX End-User Runtime Web Installer has not helped other users running Windows XP SP2 or SP3.
I really need to get this issue resolved as it is currently hurting my sales. The application can be downloaded from http://www.muvunder.com/ If anyone needs any additional information, please let me know.
Thank you,
John Rennemeyer
MuvEnum
解答
The specific issue I mentioned above with the Intellipoint software seems like the most likely culprit here as well, based on the further information you've given me. I'm guessing that TopDesk is calling PrintWindow on your hwnd to create thumbnails. Internally, this can cause WPF updates to layered windows to fail if they happen to occur at the same time as that other process calling PrintWindow. As I stated before, this bug is fixed in 3.5 SP1, but the fix did not make the public beta. The only workaround in the meantime would be to stop running the other process concurrently, or to modify your application to no longer use layered windows. The good news is that 3.5 SP1 is planned for release later this summer.
- 已標示為解答Marco Zhou 2008年7月18日 上午 10:00
所有回覆
- That error is a generic indication that the underlying graphics system has encountered a problem. Unfortunately, it does not provide enough information to diagnose the problem. It is unlikely that updating the DirectX runtime will fix the problem for all your users. I attempted to reproduce the problem on both a Vista and an XP machine but was unable to - I'm not sure what to look for. Can you provide a more detailed account on how to recreate the problem? Does it only affect users on XP SP2? It would be even better if you could provide a simplified repro project for debugging - you can send it to brendan.clark@microsoft.com.
Also, it looks like your application is using a layered window. There is a known issue fixed in 3.5 SP1 where a WPF app with layered windows can crash if you are running Intellipoint mouse software (ipoint.exe), which could be a potential cause. Also, there have been updates released to address performance issues with this feature (included in XP SP3 and Vista SP1). If you haven't upgraded to the latest service packs, I would advise installing this hotfix for XP:
http://support.microsoft.com/kb/937106/en-us
or this for Vista:
http://www.microsoft.com/downloads/details.aspx?FamilyId=140AA58E-C363-4EA4-8836-F0119EF3F763&displaylang=en
though this is unlikely to fix the crash. - The only way I have been able to recreate the issue on my development machine (Windows Vista SP1 x64) is by installing TopDesk and then using its Win+Tab feature like crazy, but even then it may take a bunch of messing with that to get it to error out and sometimes it doesn't error out at all. I was able to break on the exception in my unhandled exception handler but it didn't give me any more info than what you had.
I'm figuring the fix would be .NET 3.5 SP1 so I'm really wondering about a release date for it? Any word on this?
Thanks,
John The specific issue I mentioned above with the Intellipoint software seems like the most likely culprit here as well, based on the further information you've given me. I'm guessing that TopDesk is calling PrintWindow on your hwnd to create thumbnails. Internally, this can cause WPF updates to layered windows to fail if they happen to occur at the same time as that other process calling PrintWindow. As I stated before, this bug is fixed in 3.5 SP1, but the fix did not make the public beta. The only workaround in the meantime would be to stop running the other process concurrently, or to modify your application to no longer use layered windows. The good news is that 3.5 SP1 is planned for release later this summer.
- 已標示為解答Marco Zhou 2008年7月18日 上午 10:00
- I am also encountering this problem. It is very reproducible.
I am running WinXP with SP3 v3311, all latest service packs and patches have been applied.
I have an AMD64 X2 machine with NVIDEA GeForce 6150 on the motherboard. It has dual monitors (1920x1200 and 1440x900).
Whenever I try to drag the open MuvUnder Cover application window from the larger to the smaller display it disappears.
I am unfamiliar with TopView, so I don't think I have this installed.
I have a logitech cordless mouse with HID-compliant mouse driver, so I don't think I have the Intellimouse drivers installed. - Hi I am having similar problems when i run a video using mediaelement. I am using Vista Ultimate sp1. I get this error on a mpeg file. there are other files which work file using mediaelement.. I see many people are facing the same problem. Any solutions please ?
Cheers,
Ashish. - Brendan,Is there any safe way to capture a thumbnail of a WPF window (on XP and Vista)? Even if the WPF window is not Layered, PrintWindow displays a black box for all WPF windows that I have tested.Thanks,Mo

