Folders, Virtual Directories & Applications In IIS
In IIS there can be folders, virtual directories and applications. But what are they and how to create them?
- Folder: a space used to store files, other folders, and shortcuts on a computer. The root folder for the IIS default website is located at: “C:\inetpub\wwwroot”.
In you IIS Manager right click on the default website and that should take you to the root folder for this website
If I create a folder under this path called “TestFolder” notice that, after I refresh the IIS Manager, it recognizes it immediately as it is living the root folder of the website.
But what happens if I have a folder living outside the root folder. Let’s say a have a folder called: “MoreContent” living in the desktop:
How do I include it in my IIS? That’s what Virtual Directories are for.
- Virtual Directory: directory that maps a logical directory to the physical location of the files on the local or remote server. It enables you to include content that is not physically stored under the website’s root folder.
Right click on the website and “Add Virtual Directory”:
Next, you will specify an Alias and select the actual physical location of the folder:
Now, in your IIS Manager you will see a slightly different icon. This means is a Virtual Directory.
- Application: is a folder or a virtual directory that can be assigned to a different Application Pool. An application Pools represents a dedicated process space with one or more threads for handling incoming client requests. Use this when you want a new application root, appdomain isolation or want a subfolder to be in a new application pool.
I created a folder called “MyAppPool” in the root folder, right click on it and select “Convert to Application”:
The key difference here is that you can assign a different Application Pool to this Application. It does not force you to use the Application Pool the website is using (DefaultAppPool).
- A Virtual Directory is a directory that maps a logical directory to the physical location of the files on the local or remote server.
- An Application is a folder or a virtual directory that can be assigned to a different Application Pool.
- The key difference of an Application is that it can be assigned to a different Application Pool.