Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a new website on IIS: Application vs. Virtual Directory. Whats the difference?

Tags:

iis

When you create a new website on IIS, you get to choose between an "Application" and a "Virtual Directory". What is the difference between those two options?

like image 859
cllpse Avatar asked Jun 16 '09 17:06

cllpse


People also ask

Why do we use virtual directory in IIS?

For example, you might use a virtual directory when you want your application to include images from another location in the file system, but you do not want to move the image files into the physical directory that is mapped to the application's root virtual directory.

How do I convert virtual directory to application in IIS?

In IIS Manager, expand the node for the local computer and then expand the Sites folder. Right-click the folder that you want to convert to an application and then click Convert to Application. The Add Application dialog box is displayed. Click OK.

What does create virtual directory do?

Virtual directory in a directory that is created in IIS to host a local application or go to a particular folder on the server physical or virtual directory is created . For example: in the development team , if you wish to receive your application, you must create a virtual directory and specify the physical path.

What is a virtual directory on a Web server?

A virtual directory is a path or alias within a website that refers users to another directory where the actual data is hosted. The referred directory can be a physical directory on a local server's hard drive or a directory on another server (network share).


2 Answers

A virtual directory is just a pointer to where web pages are stored.

An Application reserves memory in IIS for your web pages. If you are attempting to run ASP pages and plan to make use of session variables and the such then you must use an application. An Application can make use of a virtual directory or it may just exist within the default web site directory (inetpub/wwwroot/)

like image 67
Jay Avatar answered Oct 02 '22 07:10

Jay


There are a few differences, here are the biggest:

  • In IIS 6 and up, you can assign an application a certain "protection" level. (e.g. protection levels, application pools, etc). You can't do this with Virtual Directories
  • If you are working with ASP.NET, the search for the master "Web.config" file for your application stops at your application level. For a working directory it will actually check your parent hierarchy for settings as well.

These are the two biggest differences in my opinion, although there are other small ones as well.

like image 40
Mike Marshall Avatar answered Oct 02 '22 09:10

Mike Marshall