How to host website on IIS

In this tutorial let us go through steps of hosting asp.net website on IIS(Internet Information Services). In this tutorial I am hosting mvc website on IIS which is installed on local machine.

Steps to Host .net Website on IIS (Internet Information Services)

Step 1: To open IIS in command prompt type “inetmgr” as shown in below screenshot:

Inetmgr option to open IIS

Step 2: In IIS right click on Sites option and then select Add Website as shown below:

Add Website option in IIS

Step 3: In Add Website Dialog window enter name for new website, In Physical path browse for the location of website on computer which you want to host. In Port number specify port on which site to be hosted, default port number is 80.

Physical path of website on IIS hosting

Step 4: After doing setting as mentioned in step 3 click on Ok button:

Port number for website in IIS

Step 5: Now site is added into IIS, to run site on browser right click on website and then select Manage Website->Browse as shown below:

how to open website in browser from IIS

If everything is configured correctly, then site will be hosted on IIS. Now you will be able to run asp.net website from IIS.

 

How to Connect with TFS (Team Foundation Server) in Visual Studio

This article will list out all the steps required to connect with source control Microsoft Team Foundation Server(TFS). In this example I am using Visual Studio 2015 and Team Foundation Server 2015. Same steps can be followed for other version of Visual studio and TFS.

Note: Before connecting with TFS you should know the address (url) of TFS with which connection is to be established.

Steps to Connect with TFS (Team Foundation Server) using Visual Studio IDE:

Step 1: Open Visual Studio and then click on Menu Team, then select option Manage Connections as shown in below screenshot:

Manage connection option under Team menu in visual studio

Step 2: Now in Team Explorer select option Connect to Team Project as shown below:

Connect to Team Project option in Team Explorer

Step 3: In Connect to Team Foundation Server window click on option Servers as shown below:

Servers option in Team Foundation Server window

Step 4: Now in Add/Remove Team Foundation Server window click on option Add as shown below:

Add button to connect with TFS

Step 5: In Add Team Foundation server window enter url or name of the TFS server, port number and then click on Ok button as shown in below screenshot:

TFS url or name for connection

Finally click on Connect button as shown below, so using these steps you can connect to Team Foundation Server from Visual Studio.

Connect button to connect with TFS

How to Install IIS(Internet Information Services) on Windows 10

This article lists out steps using which IIS can be configured on windows 10. IIS server is used for hosting asp.net websites. Sometime .net developer needs to host  website on IIS server for debugging purpose on their local machine.

Steps to host/configure IIS(Internet Information Services) on Windows 10

Step 1: Click on Window Icon and then choose Control Panel option as shown in below screenshot:

Open control panel in windows 10

Step 2: In control panel window select the option Programs as shown below:

Select Programs in Control Panel

Step 3: Next click on option Turn Windows features on or off as shown in below screenshot:

Turn windows features on or off in windows 10

Step 4: In Turn Windows features on or off dialog select the check box Internet Information Services as shown below:

Select option Internet Information Services in windows 10

Now installation of IIS feature will take sometime and progress window will be shown as shown below:

Internet Information Services installation in windows 10

Restart your computer and then type IIS in search bar then you can see Internet Information Services as shown below:

How to open IIS in windows 10

By using above steps IIS can be configured on windows 10.

Debug Site Hosted on IIS using Visual Studio

This tutorial guides through the steps required to debug an asp.net website which is hosted locally on IIS. By following steps mentioned here a user can debug any asp.net site using Visual Studio IDE.

Note: Important point to keep in mind is that visual studio should run as an administrator. To run VS as an administrator right click on it and then select the option Run as administrator as shown below:

How to run Visual Studio as an Administratro

Step 1: Make sure the site is running through IIS locally, to run site select the option browse as shown in screenshot below:

Run or browse site from IIS

Step 2: In visual studio apply the breakpoint where you want to start the debugging. In this tutorial I am running default MVC application and applied breakpoint on Index action of Home Controller.

Select menu Debug and then click on option Attach to process or use keyboard shortcut Ctrl+Alt+P as shown below:

Attach to process for debugging site using IIS

Step 3: In Attach to Process window all the process running on your system would be shown. Make sure to select the check box show processes from all users. Then look for w3wp.exe process as shown in below screenshot. Each website hosted on IIS run under w3wp.exe process:

w3wp.exe for IIS debugging

Step 4: Click on Attach button. Now your asp.net website is ready for debugging , just open the website in browser and try to hit the page where breakpoint is applied. As you open the page where breakpoint is applied debugging will get started as shown below:

Debugging asp.net from IIS locally windows 10

Using above steps .net website can be debugged locally which is hosted on IIS. Let me know in comment section if you face any challenge with above steps.

 

How to Solve Http Error 503 Service Unavailable

In this article we will go through the steps which are required to solve Http Error 503 service unavailable on IIS. One possible reason due to which 503 error is coming up due to app pool is stopped on IIS.

Http Error 503

Steps to resolve HTTP Error 503 on IIS:

Step 1: Open IIS and right click on website which is throwing Error 503 and then select the option Advanced Settings as shown in below screenshot:

Advanced-settings-IIS

 

Step 2: In Advanced Settings check out the App Pool name of the website and then close this window as shown below:

How to check app pool of website in IIS

Step 3: Now as you know app pool associated with your website. Select the option Application Pools in IIS. This option will list out all the app pools for the website which are hosted on IIS. Notice that app pool of your website which is throwing error 503 service unavailable is stopped. Right click on the App Pool name of the website and then select Start as shown below:

Start app pool to resolve Http Error 503

 

Open the website in browser and you will see that site is coming up fine. By using these steps you can resolve Http Error 503. Let me know in comment section if you face any difficulty.