共用方式為


How to: Create and Configure Virtual Directories and Applications in IIS 7.0

This topic explains how to create virtual directory in Internet Information Services (IIS) and how to configure it to run ASP.NET pages by using IIS Manager on Windows Vista Service Pack 1 and Windows Server 2008. Virtual directories are useful because they enable you to specify the URL path of an application independent of the physical disk path.

For information about how to configure a virtual directory in IIS 5.0, IIS 5.1, and IIS 6.0, see How to: Create and Configure Virtual Directories in IIS 5.0 and 6.0.

The Web Server (IIS) role must be installed with the ASP.NET role service. For information about how to install and configure IIS and about how to create a Web site, see the IIS Help or the online IIS documentation on the IIS Web site.

Creating the Virtual Directory for ASP.NET Applications

You can create a virtual directory that points to an ASP.NET application, and then convert the virtual directory to an application. Alternatively, you can directly convert a folder in the Connections pane of IIS Manager to an ASP.NET application without first creating a virtual directory. For information about how to open IIS Manager, see IIS 7.0: Open IIS Manager.

To create a virtual directory with IIS Manager for an ASP.NET application

  1. In IIS Manager, expand the local computer and the Sites folder.

  2. Right-click the site or folder where you want to create the virtual directory and then click Add Virtual Directory.

  3. In the Add Virtual Directory dialog box, specify the following information:

    • Alias. Enter a name for the virtual directory.

    • Physical Path. Enter or browse to the physical directory that contains the virtual directory. You can select an existing folder or create a new one to contain the content for the virtual directory.

  4. To provide credentials to connect to a UNC path, click the Connect as button.

  5. Click OK.

  6. Right-click the virtual directory that you created earlier and then click Convert to Application.

For more information, see Managing Virtual Directories in IIS 7.0.

Configuring an ASP.NET Application

The default root location for IIS content is the %systemdrive%\inetpub\wwwroot directory. The instructions that follow assume that you have copied the ASP.NET application to the %systemdrive%\inetpub\wwwroot directory. If you want to specify another file location for the content, you must first create a virtual directory to the content. For more information, see the preceding procedure.

To configure an ASP.NET application under the root Web site.

  1. In IIS Manager, expand the node for the local computer and then expand the Sites folder.

  2. 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.

  3. Click OK.

For information about configuration authentication, see Configuration Authentication in IIS 7.0. For information about other common administrative tasks, see Common Administrative Tasks.

See Also

Other Resources

Internet Information Services (IIS) Manager