What is a "Virtual Directory"?
joby peter
Select an image from your device to upload
If you open up the Internet Services Manager in your Administrative Tools, also called IIS Manager, and drill down you will see the logical structures. Physical directories are shown with a folder icon, while Virtual Directories are shown with a special folder icon that has a globe as part of the icon. You may also see another icon, either a box around a globe icon (Win 2K/XP) or a gear icon (W2003), which indicates the directory is an IIS Application.
So how do you create an IIS Application? First, VS.NET automatically makes all new web projects into IIS Applications, whether you want it to be or not. Otherwise, you need to use IIS Manager to create or setup an IIS Application, or get your web-host to do it for you (WebHost4Life.com has a tool for this). The easiest technique is to use IIS Manager to create a new Virtual Directory -- it will also be an IIS Application by default, which adds to the confusion.
Notice that some of the other items are only available for IIS Applications: Application Name, Configuration, Application Protection, and possibly Unload. The Configuration button brings up a dialog to map file extensions to ASP.NET, or other processes, as well as options like session state enable and timeout. The Application Protection drop-down determines if this IIS Application is to be isolated in its own process, pooled with other apps, or in-process with IIS.
IIS Applications also have events that can be defined in a global.asa/asax file. Global.asa/asax events only get executed for IIS Applications, and only if the file is at the app-root -- note that "asa" stands for Active Server Application. IIS Applications start when the first page in them is requested, and continue to run until they are stopped, either manually with the Unload button, or due to timeouts or other constraints automatically applied in ASP.NET configuration.
Virtual directories are aliases for directory paths on the server. It allows moving files on the disk between different folders, drives or even servers without changing the structure of web pages. It avoids typing an extremely long URL each time to access an ASP page.