Thursday, 26 January 2017

How to publish and host ASP.NET Web Application into IIS

In this article, I am going to explain you how to publish an ASP.Net web application and deploy or host the application into IIS. I have created a Sample ASP.Net web application as shown below. I am using visual studio 2012, .net framework 4.0 and IIS (version 7.5).

Creating new web application

Now we need to first publish the application. Right click on WebApplication1 and click on Publish as shown below.

Publishing web application.png

Now the new window will open as shown below. Now we need to select or import a publish profile. I am selecting a new profile and giving its profile name as Test as shown below.

Create your publish profile name Write your profile name

After that select File System from publish method drop-down and give path (Ex. E\publish) for Target location as shown below and click on publish.

Select file system as publish method

You will get publish succeeded message in output window as shown below and code will be published as specified location as (Ex. E\publish).

After successful publishApplication publish location

Now the next step is to deploy application into IIS. Go to Run by pressing (Windows+R)and type inetmgr to open IIS as shown below.

Open IIS using inetmgr

Now IIS will open. Go to Sites -> Default Web Site and click on Add Application as shown below.

Add new application on IIS

Now the new window will get opened as shown below. Give your application's name (or Virtual Directory name) as Test (in my case), select DefaultAppPool as ASP.NET v4.0 (in our case it is 4.0) and Physical path as E:\publish as we had published.

Select application physical path and apppool

Now the virtual directory Test will be created. Now the final step is to browse application from IIS as shown below. Go to content View, right click on WebForm1.aspx and browse the application.

Browse application from IIS

Finally, we can see the application in browser as shown below where localhost is the web-server, Test is our application's name and WebForm1.aspx is the page name.

View application in browser

Related Articles

  1. How to install Internet Information Services (IIS) 7.5 on Windows 7 Professional


Post a Comment

Email Subscription

Subscribe to our newsletter to get the latest articles directly into your inbox

Blog Archive