Home   Subscribe   Linkedin
  Archive Contact  

How to deploy Silverlight web application through installer

Suppose we want to create  MSI installer package of Silverlight web application for server deployment using Microsoft Installer.

For this, we need to utilize Microsoft Visual Studio "Web Deployment" project template and "Web Setup" project template.

Web Deployment project template comes only when we install its plugin. We can download its plugin from here.

Now in our web project we will right click and Add Web Deployment Project

1

 

This will prompt me for what I want to name the project and where to store its project file:

2

The web deployment project will then show up as part of my solution. We can change some optional settings by double clicking it

3

We have choose the default option for output assemblies  i.e  to merge the entire web-site into a single assembly that we can name whatever we want. This merges the output of all page/control compilation, app_code, and web-services into a single assembly (leaving one file to deploy).

Now, its time to add another project which is "Web Setup" project. This project actually creates MSI package. To add Web Setup project, right click on the solution in Solution Explorer and click "Add" then "New Project". Then, select "Web Setup Project" from Visual Studio project templates list. "Web Setup Project" will be available under "Setup and Deployment", which in Visual studio 2010 is under "Other Project Types".

4

We can see our project is added

5

Now, lets define the "Project Output" for the Web Setup project we just added. Right click on Web Setup project and click Add>Project Output

6

Now we will see "Project Output" dialog box. Project Output defines what output we want to include in our MSI package. In our case, we want output of pre-compiled website generated by Web Deployment project. So, select Web deployment project from "Project:" dropdown as your output project name and and select "Precompiled Web Outputs" from the listbox and click "OK".

7

This will add "Precompiled Web Outputs" to the Web Setup project.

8

Now, lets configure "Project Dependencies". "Project Dependencies" will set dependency or order in which each of the projects will get compiled. This will set the priority on how you want to perform your build.

9

Since our main Silverlight project is not dependent on anything, it should build first. Then our website should be build as it is dependent on Silverlight project. Then it should build WebDeployment project as it depends on WebSite build. Finally WebSetup project should build, which depends on both WebSite build and WebDeployment build.

image 

image

image

image

Noe we need to configure "Configuration Manager". "Configuration Manager" settings will tell Visual Studio which projects to include during "Release" build and "Debug" build.
To get "Configuration Manager" dialog, right click on the solution in "Solution Explorer" and click "Configuration Manager".

11

In "Configuration Manager" dialog, include all  projects for "Release" build and just include WebSite for "Debug" build. We normally create MSI package for server deployment only from "Release" build.

image

image

And Finally, we can build the entire solution by clicking "Build Solution

If everything goes fine and the build is successful, we will be able to see the MSI package under "Release" folder in Web Setup setup project file path

12

Now we can install this MyUserControl.msi

image

image

image

image

Now our web project has been deployed. We can check it by opening IIS

13

also we can browse our application

14

(Note Directory Browsing should be enabled )

image

and after clicking MYucTestPage we will get our result

image

I have attached the sample application..

MyucMsi.rar (459.43 kb)

Posted by: Mohd Ahmed

Categories: ASP.NET, IIS, msi, Silverlight

Tags: , , , ,