Add a Silverlight 2 application to a website

This page applies to Silverlight 2 projects only

To deploy your Silverlight 2 application, all you need to do is copy the compiled .xap file to a web folder, and call the .xap file from a web page in the same way that the test page (Default.html or TestPage.html) calls the .xap file. To copy the files, you can use xcopy or the import and deployment tools of a website creation tool such as Microsoft Expression Web 2 or Microsoft Visual Studio 2008.

When someone browses to your web page, your Silverlight 2 application will be displayed. Alternatively, if users do not have the Silverlight 2 runtime installed, they will see an installation message and a link.

To deploy a Silverlight application using xcopy

  1. Build and test (F5) your Silverlight 2 project. When you build and test a Silverlight 2 project, the following files are created in the \bin\debug folder, and Expression Blend tries to open the starting web page.




    A Silverlight 2 version of the AppManifest.xml file.

    Default.html (or TestPage.html if the project was created with Visual Studio 2008)

    A web page that loads the Silverlight 2 application (contained in ProjectName.xap) into the browser.


    The compiled assembly of the application that you designed in the content files of your project.


    Debug information for the application.


    A compressed archive that includes all the content and resources for the Silverlight 2 application. Users download this file on their browsers and run it with the Silverlight 2 plug-in.

  2. Copy the ProjectName.xap file to a folder on a website. For example, if you have Internet Information Services installed, you could copy the .xap file to a virtual directory in the default site that is typically mapped to C:\Inetpub\wwwroot.


    If your application includes Microsoft Expression Encoder 2 files or media files, you'll have to copy those files also.

  3. To test your deployment, you can copy the test page (Default.html or TestPage.html), or you could code from the test page to an existing web page in the web folder. Be sure to change the name of the .xap file to match the .xap file in your application.

  4. Browse to the web page that calls your Silverlight 2 application to test how it appears.

Next steps