How to resolve ehExtHost crashes that can occur when launching Media Center

I have heard from a few customers in recent weeks who received an error dialog every time they launched Windows Media Center.  This dialog had the following title and text:

  • Title: ehExtHost - Common Language Runtime Debugging Services
  • Text: Application has generated an exception that could not be handled.

Windows Media Center was usable after dismissing this dialog, but it was really annoying to have to dismiss it each time Windows Media Center was launched.  Since I have seen this issue multiple times recently, I wanted to describe some troubleshooting steps that can be used to resolve this issue in many instances.

The ehExtHost process is a hosting process for Windows Media Center add-ins.  When it crashes, it typically means that the add-in itself has crashed inside of its process space.  Windows Media Center supports a type of add-ins known as background add-ins.  These add-ins are launched when Windows Media Center is launched and run in the background as long as the main Windows Media Center process is running on system.  When ehExtHost crashes immediately after Windows Media Center is launched, it typically means that an add-in registered in the background category has crashed.

In many cases, users may be unaware of what add-ins are installed on their systems, particularly in the case of Windows Media Center systems purchased from an OEM or system builder because the manufacturer may pre-install add-ins.  Without knowing what add-ins are installed on the system, it is a bit more difficult to determine which add-in is causing ehExtHost to crash.

In the cases I have seen, I narrowed down the issue by looking in the registry to determine which add-ins are installed in the background category.  Windows Media Center stores information about registered add-ins in the following registry sub-hives:

  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility

These hives normally have 3 sub-keys:

  • Applications
  • Categories
  • Entry Points

Add-ins that are registered in the background category will appear in a sub-key named ...\Extensibility\Categories\Background.  The structure for a specific add-in looks like the following (and it is valid for this structure to appear in HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE even though I only list HKLM below):

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Applications\{application_guid}]

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Categories\Background\{entrypoint_guid}]

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility\Entry Points\{entrypoint_guid}]

The {application_guid} value and {entrypoint_guid} values must match in the 2 places they are listed above, and together they represent a specific entry point for an add-in.

In the cases of the customers I talked to, they only had one add-in registered in the background category, and I had them rename the 3 registry sub-keys above and that caused Windows Media Center to stop trying to launch this add-in when starting up, and ehExtHost stopped crashing.

In some cases, it may be possible that multiple applications are registered in the background category.  In that case, I suggest renaming the sets of 3 registry values that correspond to each add-in one at a time to narrow down which add-in is causing the ehExtHost crash.

In general, it would be best to use official unstall mechanisms to unregister the add-in, but I have seen my share of add-ins that either do not create Add/Remove Programs entries or that do not correctly unregister themselves during uninstall.  Therefore it is sometimes necessary to directly edit the registry.  It is important to note that I always recommend renaming the registry sub-keys as opposed to deleting them because you can rename the sub-keys back in case something goes wrong.

Important note: most cases I have seen have been caused by uninstalling a specific Symantec Norton anti-virus add-in. I posted separate instructions in this blog post that describe how to work around this issue. Before proceeding with the instructions in this post, I suggest taking a look at this other blog post to see if they apply on your system.

If you are unsure about what add-ins are installed and what the possible cause of this type of crash is, you can use the following command lines to gather the relevant registry information and send them to me so I can try to advise.

  1. Click on the Start menu, choose Run, type cmd and click OK
  2. Copy and paste the following command into the cmd prompt: start /wait regedit /e %temp%\hkcu_mce_extensibility.reg "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility"
  3. Copy and paste the following command into the cmd prompt: start /wait regedit /e %temp%\hklm_mce_extensibility.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Media Center\Extensibility"
  4. Click on the Start menu, choose Run, type %temp% and click OK
  5. Find the files named %temp%\hkcu_mce_extensibility.reg and %temp%\hklm_mce_extensibility.reg, right-click on them and choose Send To, then Compressed (zipped) Folder to add them to a zip file

<update date="9/25/2007"> Added more specific information about how to create a zip file with the registry information </update>

<update date="10/19/2007"> Added a link to a specific work around that helps solve most of the ehExtHost crashes that I have seen so far </update>

<update date="2/17/2009"> Moved the note about the Symantec uninstall issue to hopefully help people find it more easily so they know to try that workaround before they export their registry keys using the steps in this blog post. </update>