다음을 통해 공유


Running Web Applications on Windows Vista with IIS 7.0 and Visual Studio

You can use Visual Studio to create and work with ASP.NET Web sites (which are also known as Web applications) in a variety of configurations. This includes Internet Information Services (IIS) sites, file-system sites, File Transfer Protocol (FTP)–deployed sites, and remote sites.

IIS 7.0 is included with Windows Vista. However, when you first install Windows Vista, by default IIS 7.0 is not installed or enabled. This topic describes how to install IIS and configure it so that in Visual Studio you can create local IIS ASP.NET Web sites. This enables you to use a local copy of IIS to run and debug the Web site instead of using the ASP.NET Development Server.

When you create a local IIS Web site, the pages and folders for the site are stored in a folder under the default IIS folder for Web sites. This is located at LocalDrive:\Inetpub\wwwroot. Visual Studio creates the appropriate IIS configuration so that the Web site is recognized by IIS as an application. 

You can also create a virtual directory. In that case, the files for the Web site can be in any folder on the Web server computer.

Installing IIS and ASP.NET on Windows Vista

Installing the ASP.NET component of IIS 7.0 in Windows Vista enables ASP.NET Web applications to run as local IIS Web sites. To enable Visual Studio to create and use local IIS Web sites, you must enable metabase compatibility. This lets Visual Studio interact with the IIS metabase and with the IIS 7.0 configuration store.

Note

You must have administrative permissions to install IIS 7.0.

To install IIS and ASP.NET on Windows Vista

  1. In , open Control Panel and then click Programs.

  2. Under Programs and Features, click Turn Windows features on or off.

    Note

    If Control Panel is set to display in Classic view, click Programs and Features, and in then in the left pane, click Turn Windows features on or off.

    The Windows Features dialog box is displayed.

    Note

    If User Account Control (UAC) is enabled, it might display a message when you try to access the Windows Features dialog box. Click Continue to access the dialog box. For more information, see User Account Control.

  3. Expand Internet Information Services.

  4. Expand Web Management Tools, expand IIS 6 Management Compatibility, and then select the IIS 6 Metabase and IIS 6 configuration compatibility check box.

  5. Expand World Wide Web Services, expand Application Development Features, and then select the ASP.NET check box.

    Note

    The options that are required for Web application development will automatically be selected.

  6. Expand World Wide Web Services, expand Security, and then select the Windows Authentication check box.

    To enable Visual Studio to debug applications, you must configure IIS 7.0 with the Windows Authentication module. By default, the module is not configured as part of IIS. 

  7. Click OK to start the IIS and ASP.NET installation process.

  8. When the configuration process finishes, close Control Panel.

Starting the IIS 7.0 Web Server in Windows Vista

After you install IIS 7.0 as described in previous procedure, users can connect to Web sites hosted by IIS by using the HTTP or HTTPS protocols.

Important noteImportant Note:

You should limit access to the Web site application to only the intended users. To do this, specify authentication, which is how an application identifies who a user is, and authorization, which is how an application identifies what users have permission to do. For more information, see Limiting Access to ASP.NET Web Sites.

You can also develop and modify IIS 7.0 Web sites and applications in Visual Studio.

To start the IIS 7.0 Web server in Windows Vista

  1. In Windows Vista, click Start, right-click Computer, and then click Manage.

    The Computer Management dialog box is displayed.

    Note

    If User Account Control (UAC) is enabled, it might display a message when you try to access the Windows Features dialog box. Click Continue to access the dialog box. For more information, see User Account Control.

  2. Expand Services and Applications, and then select Internet Information Services (IIS) Manager.

  3. In the right pane, under Connections, expand the name of the Web server and then expand Web Sites.

  4. Right-click Default Web Site, and then click Start.

  5. If you need a secure Internet connection, set up Secure Sockets Layer (SSL). For more information, see How to: Set Up Secure Sockets Layer (SSL).

Running Visual Studio with Administrative Permissions in Windows Vista

To access local IIS Web sites, you must run Visual Studio in the context of an administrator account. By default, Windows runs applications in a limited-rights user account even when you are logged on to the computer as an administrator.

To run Visual Studio with administrative permissions in Windows Vista

  1. In Windows Vista, click Start, click All Programs, and then locate Visual Studio.

  2. Right-click Microsoft Visual Studio, and then click Run as administrator.

    Note

    If User Account Control (UAC) is enabled, it might display a message when you try to access the Windows Features dialog box. Click Continue to access the dialog box. For more information, see User Account Control.

See Also

Tasks

How to: Set Up Secure Sockets Layer (SSL)

Concepts

Types of Web Sites in Visual Web Developer

Running Web Applications on Windows Server 2008 with IIS 7.0 and Visual Studio

Reference

ASP.NET IIS Registration Tool (Aspnet_regiis.exe)