Export a Package through IIS Manager
by Faith A
This quick guide will help you create a package of your Web application using the IIS Manager, including a SQL database.
This guide requires the following prerequisites:
- .NET Framework 2.0 SP1 or greater
- Web Deployment Tool
- IIS 7.0 or above, or IIS Remote Manager
Prerequisites if you're using SQL
Note: The second and third pre-requisites will be installed automatically if you install the Web Deployment Tool using the Web Platform Installer
- SQL Server Express or Standard, either local or remote
- SQL Server 2008 Management Objects (SMO) - x86 or x64
- SQL CLR Types - x86 or x64
Note: If you have not already installed the Web Deployment Tool, see Installing the Web Deployment Tool.
Export a Package
Always make a backup. Run the following command to backup an IIS 7.0 or above server:
%windir%\system32\inetsrv\appcmd add backup "PreMsDeploy"
Open the IIS Manager by clicking Start > Run and typing inetmgr.
In IIS Manager, expand the Server node and the Sites node, then select the Default Web Site/MyApplication.
The first row is your iisapp provider entry, which is your application. In the second row, choose the dbFullSql provider from the Provider Name drop-down. If you hover over a provider, you will see a description and example path.
Next you will see parameters that are generated based on the two providers that you added in the previous step. We're going to give them friendlier names and descriptions. Select the second parameter in the list, Parameter 2, and click on the Add Parameter Entry button.
Enter the scope for the parameter entry. The scope is a regular expression that tells us what file to locate in the package. In this case, we'll choose the Web.config file but we'll add \ to indicate the start of the file and $ to indicate the end of the file name so that Web.config.bak wouldn't also be updated.
Then we'll add a match. For an XmlFile parameter entry, the match is an xpath query that indicates a particular element or attribute in the XML file. We'll add an xpath pointing to the connection string attribute. Click OK to accept the entry.
You now have parameters that will allow a user installing this package to set the application path (site and app name where they want this app to be installed) and change the connection string (which will be updated in 2 places, first when running the SQL script and second inside the Web.config file). Click Next to continue.
Congratulations! You have now created a package based on the Default Web Site. It contains the application, which contains content files and an entry that will mark the folder as an application in IIS, and a SQL database.