When you compile a Silverlight project, it is all combined into a single file with a .xap
extension. This file contains the assemblies and any other content files associated with the project, which are bundled together and compressed using the ZIP file format. You can prove this by simply changing the file extension from .xap
to .zip
and unzipping the file to inspect its contents. The XAP file can then be hosted on a web server, enabling it to be downloaded and run by client computers.
Note Some compression utilities (such as 7-Zip) add items to the context menu in Windows Explorer, which you can use to open the archive without needing to change the XAP file's extension. Alternatively, you can associate the .xap
file extension with a compression utility, enabling you to simply double-click the .xap file in Windows Explorer to inspect its contents.
The easiest (and most feature-rich) way to inspect a XAP file, is to simply load it into Silverlight Spy (shown in Figure 1-21) and inspect it that way.