Support us .Net Basics C# SQL ASP.NET Aarvi MVC Slides C# Programs Subscribe Download

IIS - Internet Information Services and ASP.NET - Part 9

In this videos we will learn about
1. What is a Web Server
2. Do you need IIS to develop and test asp.net web applications
3. How to check if IIS is installed?
4. Installing IIS
5. Configuring IIS server to run asp.net web applications

What is a web server?
In simple terms, a web server, is a software, that is used to deliver web pages to clients using the Hypertext Transfer Protocol (HTTP). For example, IIS is a web server that can be used to run asp.net web applications.

Do you need IIS to develop and test asp.net web applications?
No, Visual Studio ships with a built-in web server. If you want to just build and test web applications on your machine, you don't need an IIS. Keep in mind, Built-in web server will not serve requests to another computer. By default, visual studio uses the built-in web server.



Create a new asp.net web application and run it by pressing CTRL + F5. Notice the URL of the page in the browser. A random port number is used. On my machine it was using port number 16041. 
http://localhost:16041/WebForm1.aspx

To confirm, if this is the built-in visual studio development server, check the notifications area on the task bar, and you should see ASP.NET Development Server running. Please refer to the image below.
Built-in asp.net development server

Another way to check, if visual studio is using, built-in development server.
1. Right cick on the web application project in solution explorer and select Properties.
2. On the Project properties window, click on the Web tab.
3. Scroll down to servers section - Notice that "Use visual studio development server" is selected.
4. By default, visual studio auto assigns an available port. If you want to assign a specific port, you can do so, by selecting Specific Port radio button.
Configuring Built-in asp.net development server



How to check if IIS is installed?
1. Click on the windows Start button 
2. Type INETMGR in the Run window. 
3. Click OK. 
4. If you get IIS manager window, it is installed, otherwise not installed.

How to install IIS?
1. Click on the start button and select ControlPanel
2. Click on Programs
3. Click on, Turn windows features on or Off, under Programs and features option
4. In the windows features
5. Select Internet Information Services and related services, and click OK

To configure a virtual directory in IIS to run asp.net web applications
1. In the IIS Manager window, double click on the iis server name in the connections section.
2. Expand sites
3. Right click on Default Web Site, and Select Add Application.
4. Give an alias name. This is the name you will use in the URL, when connecting to your web application.
5. Click the button next to the textbox under physical path. Select the physical web application folder.

You can also create the virtual directory from visual studio, on the project properties window.
1. Select Use Local IIS Web Server
2. Project URL will be populated automatically. You can change the name of the virtual directory if you wish to do so.
3. Click Create Virtual Directory button.
4. After a few seconds the virtual directory was successfully created message will appear.
5. Click OK

5 comments:

  1. thanks Venkat.
    this is what I was looking for :)

    ReplyDelete
  2. Hello Venkat,
    When i use the same as you are describing...when i installed IIS it through an error...It is not getting completely installed. After install, it shows a message of restart your computer. When i restarted the configuration of windows will do its process and when i use the IIS through INETMGR typed in run windows. It shows nothing. and after installing second time it shows but full component is not installed. and when i make Application though "Add Application" and going to browse it shows an error on run mode and also not working if i do through VS virtual directory..

    Please reply that what should i do know..how to overcome this problem and can easily use IIS service.

    In waiting of your reply...
    Sahil Jain

    ReplyDelete
  3. I don't want to VS built in server. I want to come my web page from installed IIS which is created in VS. Is it possible?

    ReplyDelete
  4. I am not able to deploy my website on IIS as I am using Visual Studio 2015.
    Can you please help me with that?

    ReplyDelete

  5. I have problem in set virtual directory

    The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again.

    ReplyDelete

It would be great if you can help share these free resources