Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio
All postings are provided AS IS with no warranties, and confer no rights. Additionally, views expressed herein are my own and not those of my employer, Microsoft.
Since I posted the instructions for gathering setup log files for Update Rollup 2 for Media Center 2005 and asked folks to send the logs to me, I have gotten several sets of logs. I'm still looking through some of the issues to try to figure them out (and I apologize for the slow replies to those of you who have not heard back from me yet). There is one issue that I've now seen on multiple customer machines that I wanted to post a workaround for in case anyone else runs into it in the future.
What are the symptoms of this issue?
For this particular problem, customers have reported the following types of problems while using Media Center after upgrading to Update Rollup 2:
How do I know if this issue is the one affecting my machine?
The machines I have seen that have had these problems so far have had errors logged in %windir%\medctroc.log. This log is appended to during every Media Center setup action, so you have to find the section that corresponds to the registration that happens at the end of Update Rollup 2 setup. To find this, you can search for the string 5.1.2710.2732. There should be multiple instances of this string in this log file. You will need to find the entry that is followed a few lines later by a line stating Will run in registration mode.
Once you have found the Update Rollup 2 registration section, look for the group of commands labeled Removing existing native assemblies... In each of the cases I have seen so far, there are entries in this section like the following:
Executing line "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ngen.exe /nologo /delete ehiwmp" Warning: Process Return Value is 0xc0000139 --> (null) Error: Failed to apply command to ehiwmp (return value: 0xc0000139).
Then you should see another entry in the log file during this same registration session that states:
Encountered errors during registration of Windows Media Center. Please see {C:\WINDOWS\medctroc.Log} for details.
How can I workaround this issue?
If you have the above entries in your %windir%\medctroc.log file, you can do the following to repair your computer:
What is the root cause of this issue?
There are a couple of problems that cause this issue. The first is a logic problem with the setup registration program (%windir%\ehome\medctrro.exe). When it encounters an error like the NGEN error listed above, it continues until it is done processing managed assemblies but then it stops without performing the rest of the registration steps. This means that the machine is left in the state where new assemblies from Update Rollup 2 are added to the GAC, but the ehSched and ehRecvr services and the ehRec and ehMsas executables are unregistered. These services and COM servers are used for a lot of functionality inside of Media Center, particularly TV. Therefore if they are left in an unregistered state, MCE fails in many places.
The second issue is that the command to run NGEN is failing with an unexpected error code 0xc0000139 in some cases. This error code means "entry point not found" but I have not been able to reproduce this on one of my test machines so I don't understand exactly why this error is appearing. I have asked a couple of folks who hit this problem to try running the NGEN commands directly to see if they give more descriptive error messages. I will update this blog post when I know more about the root cause of NGEN failing in these scenarios.
<update date="10/20/2005"> We have found one root cause of this type of error, and I have posted a description and a simpler workaround for this error in this blog post </update>
<update date="10/30/2005"> It appears that the link to the simpler workaround isn't being found in the update text, so I've updated the workaround to contain the steps from my newer blog post to avoid confusion </update>
<update date="1/12/2010"> Added a note about rebooting at the end of the registration process. </update>