Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How To Deploy a Web App in IIS

0.00/5 (No votes)
8 Nov 2011 1  
How To Deploy a Web App in IIS

Introduction

Listed below are the steps to deploy a web app in IIS.

  1. Click start. Click Run.
  2. Type inetmgr in the Run dialog Box.

  3. Expand the localComputer. Right Click on the Sites. Click Add New Site as shown below:

  4. Type the name of the web site. In my case, it is "MyWebSite". Type the location of the web application or site. Give a port number (You have to manually add this port number to inbound rules of Windows Firewall later). And then press OK.

    If a connection with that port number already exists, then give another port number.

  5. Right click on the site name ("MyWebSite" in my case), click on "Manage Web Site" and "Browse".

  6. In the sub directories of the web site, if any web.config files are present, remove the tags with names authorization, roleprovider, profile, members. As this may cause the error as shown below:

  7. Change the Framework of the application pool to v4.0:

  8. ******************************************

    Change the "CodeBehind" in the aspx file to "CodeFile".

    Change the URLs to the appropriate directory. (Since ~ means root directory, it has a different meaning when executed in Visual Studio when compared to IIS.)

  9. All the above steps make the site work from the same computer in which IIS is installed. If you go to another computer and type the IP address of the system (in which IIS is installed), then you may not be able to access the website. For this, you have to configure the port in the Windows Firewall.
  10. Open the Windows Firewall from control panel as "Control Panel\All Control Panel Items\Windows Firewall". Click "Advanced Settings".

    Right click on InBound Rules as shown below. And fill the details as necessary.

That's it! You can access the web site (hosted with IIS) from within the LAN by just typing the IP address of the system on which IIS is installed as:

http://IPAddress:Portnumber e.g.:- http://192.168.1.1:90 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here