How to Deploy Website on IIS

There are two approaches to Deploy website on IIS.

Approach 1: Web Deployment Package from VS2010
 
1.jpg

Approach 2: Publish Option from VS2010
 
2.jpg
 

Approach 1: Web Deployment Package

In VS2010 you can create a web Deployment Package which you can import from IIS to deploy you web application. Follow these steps to accomplish this:

1, Right click you asp.net web application project and select "package/Publish Setting".

3.jpg

2, Provide a few basic data in the configuration from (you may not want to change any setting in the first attempt).Select the project and click on properties.

4.jpg

3, Right click on the project and select "Build Deployment Package". Visual studio will build the deployment package (zip file) and will store in the default location.

5.jpg

4, Open IIS manager(type "inetmgr" in Run command), Right click on the target web site (where you want to deploy you Asp.net application),Select deploy=>Import application

6.jpg

Important Note

If your IIS doesn't have this Deploy option then you need to install Extension of the IIS.

So that visits this web site:

http://www.iis.net/downloads/microsoft/web-deploy click on Install this Extension

install that extension and you will get this message.

install-Extension-of-the-IIS.jpg

Then will be able to see the deploy option in IIS.

5, Browse the deployment package file (the Zip file) to select it and select "Next" buttons on wizard steps and click the "finish" button on the last step. You can alter the connection string in wizards steps.

7.jpg

6, Now Browse your website from the IIS.

Approach 2: Publish option from VS2010

You need to create simple website in iis, but careful about Application Pool version if your application version is less than 4.0 then Pool version should be 2.0.

Then from VS2010 Right click on application and select publish Option

8.jpg
 
A form will appear where you need to provide some basic information (The target host name and Site/Application name). Provide these two information and (Along with, check the check box "Mark as IIS application on destination") click on the "Publish" button to publish the web application.
 
9.jpg

Service URL: Localhost

Site/Application: Name of Website which you have created in IIS/folder name in which you have store application data for website.

Select option Mark as IIS application on destination.

Click on Publish.

Important notes

Enable the directory Browsing.

  • If you are getting error that pool is not ableto login then change the connection string and provide the Username andpassword in connection string and set false to Integrated Security.

Example:

<add name="ConnectionString" connectionString="Data Source=Servername;Initial Catalog=databaseName;User ID=Userid;Password=password;Integrated Security=false"

                providerName="System.Data.SqlClient" />

Up Next
    Ebook Download
    View all
    Learn
    View all