How-To Set Up a Build Machine to Compile Media Center Projects

  1. Depending on the requirements of the project, install the appropriate version of .NET Framework.
  2. Install Media Center SDK. Either the Vista or 7 version should work.
  3. If your build machine is Windows Server 2008, find an already running Windows Vista installation and copy Microsoft.MediaCenter.dll, Microsoft.MediaCenter.UI.dll and ehres.dll from “C:\Windows\eHome” to a folder on the server. (Note that additional assemblies may be required depending on what is referenced in the project.) If the build machine is Windows Server 7, copy the same assemblies from a running Windows 7 installation instead.
  4. Use GacUtil.exe to register Microsoft.MediaCenter.dll and Microsoft.MediaCenter.UI.dll into the Global Assembly Cache. GacUtil.exe ships with several Microsoft products and each one installs it into a different location. The .NET Framework SDK registry entry claims the SDK installs to “C:\Program Files\Microsoft SDKs\Windows\v6.0A” but that isn’t always true. If the SDK is installed as part of Visual Studio, the SDK will be at that path, but if it is installed as part of Windows SDK for Windows Server 2008 and .NET Framework 3.5, the SDK will be at “C:\Program Files\Microsoft SDKs\Windows\v6.0”. (Note the lack of an “A” at the end of the path.) If the SDK is installed as part of Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1, the SDK will be installed to “C:\Program Files\Microsoft SDKs\Windows\v7.0”. GacUtil.exe will be in the “bin” folder in the root of the SDK folder.
  5. Copy Microsoft.MediaCenter.UI.dll to “C:\Program Files\Microsoft SDKs\Windows Media Center\v6.0\Tools” so McmlVerifier.exe can find the assembly. If the project uses resources from ehres.dll, copy it to the same location.

Note that depending on how the project handles the McmlVerifier task, you may need to write a custom BuildTask to handle multiple build environments.

At this point you should be able to compile Media Center projects from the command line on the server using MSBuild. If your command line build works properly it should also work properly from a Continuous Integration server.