Creating, Installing, and Running a Windows Media Center Presentation Layer Application

This walkthrough describes the general process of creating, installing, and running a Windows Media Center Presentation Layer application. It is assumed that you are using the recommended development environment (see Development Tools for the Windows Media Center SDK).

  1. Create a new project.

    • In Visual Studio, on the File menu, point to New and select Project.
    • In the Project Types pane, expand Visual C#, and select Windows Media Center.
    • In the Templates pane, select Windows Media Center Presentation Layer Application.
    • Enter a name for the project, select a location, and then click OK.
  2. Write the code for the application.

    • Edit the AddIn.cs file with the code for the application.
  3. Sign the assembly.

    For information about signing an assembly, see Creating a Strong-Named Assembly.

    • Use Visual Studio to create a strong-name key file and sign the assembly.
  4. Add your application to the global assembly cache (GAC).

    • Use the Global Assembly Cache Tool (Gacutil.exe) to install the assembly, using the following syntax: GacUtil /I AssemblyPath

      For more information about adding an application to the GAC, see Global Assembly Cache on the MSDN Web site. For more information about the GAC tool, see Global Assembly Cache Tool (Gacutil.exe) on the MSDN Web site.

  5. Register your application.

    For more information about how to register an application, see Associating Application Entry Points with Integration Locations.

    • Modify the App.xml file, which contains the registration information.
    • Use a GUID-generating utility such as guidgen.exe to create two GUIDs: one for the application ID, and the other for the entry point ID.
    • For the addin attribute of the entrypoint element, the registration XML file uses NamespaceName.ClassName, AssemblyName, Version, and PublicKeyToken from your assembly. You can find out what the Version and PublicKeyToken values are by listing the assemblies in the GAC (use the command GacUtil /l assembly, without specifying a DLL extension.)
    • Call RegisterMCEApp.exe path to xml file.
  6. Run your application.

    • Start Windows Media Center and browse to Online Media, then Program Library.
    • Start your application.

See Also