Creating a Strong-Named Assembly

Windows Media Center loads only locally-stored assemblies, which reside in the Global Assembly Cache (GAC). For security purposes, the GAC requires that all .NET assemblies, including Windows Media Center applications, have strong names. Therefore, Windows Media Center can only load a Windows Media Center application if it is a strong-named assembly.

The following is the minimum information required to create a strong-named assembly:

  • Assembly title in plain text.
  • Assembly version number.
  • Cryptographic key-pair file used to digitally sign the assembly.

The Strong Name tool (sn.exe) included with the Microsoft .NET Framework 2.0 SDK can also be used to create a strong name key file. This tool creates the key with the file name you specify. The following example creates a pair of cryptographic keys with this tool and stores them in a file called KeyPair.snk:

sn -k KeyPair.snk

Note Anyone who has access to the key file can sign assemblies with your identity. After you create the strong name key (.snk) file, store the file in a secure location.

Delayed signing is another option for a Windows Media Center application assembly. Delayed signing reserves space in the assembly for the strong name signature, but defers actual signing until a later stage, typically just before shipping the assembly. This process allows you to closely guard your cryptographic key pair during the development stages of your Windows Media Center application.

For more information, see the following topics on the MSDN web site:

See Also