Walkthrough: Creating ASP.NET Web Application Root Directories in IIS 

The steps in this walkthrough show you how to mark a directory as an application root directory using Internet Information Services (IIS) version 5.0 or later. The walkthrough tells you how to create a virtual directory and set the C:\Inetpub\Wwwroot directory as the root directory for your application.


Though ASP and ASP.NET pages will run in a virtual directory that is not an application root, creating an application on the virtual directory changes the values of certain server variables (APPL_PHYSICAL_PATH, APPL_MD_PATH). These server variables allow ASP and ASP.NET to work with application-scoped features, such as the expected location of a Global.asa file or Global.asax file.

To prepare for this walkthrough

  • Create a new physical directory. The first section of this walkthrough uses the directory C:\exampleWebApp.

  • Create a new physical directory in the C:\Inetpub\Wwwroot directory. The second section of this walkthrough uses the directory C:\Inetpub\Wwwroot\exampleWebApp.

Open Internet Information Services (IIS) Manager by using one of the following procedures.

To open IIS Manager from a command prompt

  1. On the Start menu, click Run.

  2. In the Open dialog box, type in inetmgr, and then click OK.

To open IIS Manager using a member of the Windows Server 2003 family

  • Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager.

To open IIS Manager using Windows XP

  1. On the Start menu, click Control Panel.


    If you are using the Windows Classic theme for your desktop display, the Control Panel menu item is on the Settings menu.

  2. If you have not done so already, click Switch to Classic View.

  3. Double-click Administrative Tools, and then double-click Internet Information Services.

To open IIS Manager using Windows 2000

  • On the Start menu, point to Applications, point to Administrative Tools, and then click Internet Service Manager.

Use the following procedure to create a virtual directory that is mapped to physical directory that is not in the C:\Inetpub\wwwroot folder. Creating a virtual directory in this way automatically creates a Web application on the virtual directory.

To create a virtual directory

  1. In IIS Manager, expand the local computer node (which might be indicated by your computer name), expand Web Sites, and then click Default Web Site.

  2. On the Action menu, click New, and then click Virtual Directory.

  3. In the Virtual Directory Creation Wizard, click Next.

  4. In the Alias box, type the name that you want for your new application, and then click Next.

  5. In the Path box, type the physical directory that you created to prepare for this walkthrough, C:\exampleWebApp, and then click Next.

    Alternatively, you can click the Browse button to browse to your directory.

  6. On the Access Permissions page, make sure that the Read and Run scripts check boxes are selected, and then click Next.

    Security noteSecurity Note

    Read and Run are the only permissions that are required to run ASP and ASP.NET pages. It is recommended that you use the minimum necessary permissions to allow clients to view your Web site. For more information, see Securing Sites with Web Site Permissions in the IIS Operations Guide.

  7. Click Finish.

    Your new Web application is created and highlighted in IIS Manager.

You can also create an application root directory from an existing directory in Inetpub\Wwwroot. All physical directories under Inetpub\Wwwroot are treated as virtual directories by IIS, but they are not considered applications until the following procedure is used.

To mark an existing virtual directory in Inetpub\Wwwroot as a Web application using IIS

  1. Open IIS Manager and browse to the Default Web Site as shown in the previous procedures.

  2. Expand the Default Web Site node and look for the subdirectory that you want to designate as an application root. For this example, this is exampleWebApp.

    If IIS Manager was already open when you created the physical directory, you might have to click the Refresh button in IIS Manager to view your new exampleWebApp subdirectory.

  3. Right-click the directory that you want to mark as an application root, and then click Properties.

  4. On the Directory tab, in the Application Settings section, click Create.

  5. In the Application name text box, type the name of the application, and then click OK.

    The virtual directory is now an application root.

Community Additions