On the Signing tab you can specify strong-names for the assemblies in the application. You can choose whether to sign elements in the assembly and which specific elements to sign. By default all elements are unsigned. If you want your assemblies to be strong-named, you have to check them on the list and then specify the "snk" file that will be used to sign the assemblies.
The Signing tab appears similar to the following:
The Signing tab includes elements, such as:
• Sign assemblies in this XAP check box
The Sign assemblies in this XAP check box lets you determine if assemblies in the XAP file should be signed or not. By default this check box is not checked and assemblies are not signed.
• Assembly grid
The assembly grid lists each assembly included in the XAP file. You can interact with this grid only if the Sign assemblies in this XAP check box is checked. To specify the SNK file that will be used to sign the assemblies, click the drop-down arrow in the Strong name key file field for an assembly and create a new file or open an existing one.
To sign assemblies in the XAP file, you must enable signing assemblies and choose a strong name key file for signed assemblies.
Note: For assemblies to be signed, on XapOptimizer's Option screen you must have chosen a location for the Strong Name application included with Visual Studio (SN.exe). For more information, see Customizing XapOptimizer Options.
Signing Assemblies
Complete the following steps to sign assemblies in your XAP file:
1. Check the Sign assemblies in this XAP check box to enable signing assemblies in the XAP file (by default assemblies in your XAP file are not signed).
2. Click the drop-down arrow in the Strong name key file field for each assembly that you want to sign and:
• Choose New to create a new strong name key file. Browse to a location and enter a name in the Save As dialog box and click Save to create your file.
OR
• Choose Browse to open existing new strong name key file. In the Open dialog box browse to your file's location, select your file, and click Open to open your file.
The strong name key file name and location will appear next to the assembly name.
Once you are done configuring signing, you can click the Save button on the top right of the screen to save your options. See Saving a XapOptimizer Project for more information. Note that signatures in third-party signed assemblies will be removed when using XapOptimizer. For details see the Limitations and Troubleshooting topic.
Note: The .NET Framework security policy forbids singed assemblies to load unsigned ones. So, when you manually choose to sign an assembly in XapOptimizer, you must ensure that all the assemblies it references are going to be signed as well. If you do not, a System.IO.FileLoadException exception will be thrown with the following message: "A strongly-named assembly is required'.