Share via


Deploy a Silverlight application to a website

0b2c798e-86c6-4ea2-a8a6-5cf1f12be1e2

To deploy your Microsoft Silverlight 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 or Microsoft Visual Studio 2012.

When someone browses to your web page, your Silverlight application will be displayed. Alternatively, if users do not have the Silverlight 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 project. When you build and test a Silverlight project, the following files are created in the \bin\debug folder, and Blend tries to open the starting web page.

    File

    Description

    AppManifest.xaml

    A Silverlight version of the AppManifest.xml file.

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

    A web page that loads the Silverlightapplication (contained in ProjectName.xap) into the browser.

    ProjectName.dll

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

    ProjectName.pdb

    Debug information for the application.

    ProjectName.xap

    A compressed archive that includes all the content and resources for the Silverlight application described above. Users download this file on their browsers and run it with the Silverlight 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.

    Note

    If your application includes Microsoft Expression Encoder 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 copy 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 application to test how it appears.

For more information about deploying a Silverlight application to a website, see one or more of the following: