How to deploy Visual Studio 2010 web application project with SQL database using Web Deploy?

This demonstration shows how to deploy Web Application project of Visual Studio 2010 having SQL database using Web Deploy method on AccuWebHosting server.

Step: 1

Open the project in Visual Studio 2010. First of all, change the Configuration settings of your project. In general, the status is set to Debug but for deployment you need to change it to Release status.

For configuration settings perform the following steps:

  1. Click Build-> Configuration Manager.
  2. From the Configuration Manager Dialog box figure out Active Solution Configuration option. From the drop down menu select Release status and then close the dialog box.

    Configuration Manager Settings


Step: 2

Add connection string in web.config file between <connectionStrings>... </connectionStrings>

<add name="testDBConnectionString"connectionString="Data Source=IP address of local machine OR Database Server;Initial Catalog=databaseName;User Id=databaseUser;Password=password;"providerName="System.Data.SqlClient"/>

Step: 3

Click on Project-> Package/Publish Settings. Select Package/Publish SQL option. Click on Import from Web.config button. In Database Entry Details specify the following information:

Destination Database Information

Connection string for destination database:
Data Source=, 1533;Initial Catalog=databaseName;User Id=databaseUser;Password=password;


  1. databaseName - name of the database created from the WebsitePanel
  2. databaseUser - user assigned to database from the WebsitePanel
  3. password - which has been set for the database user


Source Database Information

Mark Pull data and/or schema from an existing database option. Specify the Connection string for the source database as below:

Data Source=IPAddress;Initial Catalog=databaseName;User ID=sa;Password=password;


  1. IPAddress - local machine's IP address
  2. databaseName - name of the database created on local machine from SQL Server Management Studio
  3. sa - local user to access the database
  4. password - password of sa user


Step: 4

To deploy the application perform the following steps:

  1. Click Build-> Publish <Web Application Name>
  2. You can also use the Solution Explorer where, right click on the application name and then select Publish option. It will display following dialog box:

    Web Deploy Settings in Publish Profile


  1. Specify profile name if you want to change it otherwise by default it is Profile1.
  2. Change Publish Method to Web Deploy.
  3. In Service URL, there are three options available:
    • To deploy locally,
    • To deploy the application remotely through Remote Agent Service,
      http://<IP Address of Remote Computer>
    • To deploy the application through Windows Management Service, use the value specified by your Hosting Provider,
  4. Next option is Site/Application. Its value must be in the form of <IIS Website Name> or <IIS Application Name>
  5. For the local servers, use the name of the website and application as specified in IIS Manager.
    For example,
    Default Web Site/<ApplicationName>
  6. To publish the application remotely, use the value given by your hosting provider which contains a domain or domain and application name
    For example,
  7. Check "Mark as IIS application on destination" option.
  8. Check "Allow untrusted certificate".
  9. In the Username and Password field specify your Control Panel login username and password that has been given either by your Administrator or by your Hosting Provider.
  10. Click on Publish.

1. The value of "Service URL" for Windows Shared Hosting plans are as below.

Windows 2008 clients is - 
Windows 2012 clients is -

2. The value of "Service URL" for Windows VPS - https://YourVPSIP:8172/msdeploy.axd

Was this answer helpful?

« Back