共用方式為


Local IIS Web Sites

A local Internet Information Services (IIS) Web site is an IIS Web application on your computer. Visual Web Developer communicates with the Web site by using the HTTP protocol.

Creating or opening a local IIS Web site is useful in the following situations:

  • You want to test your Web site using IIS, which closely emulates how the Web site will run on a production server. This can have advantages over working with file system Web sites that run using the ASP.NET Development Server, because paths are resolved as they will be on a production server.

  • You already have a set of Web site files in a folder and you want to test the Web site with IIS. In this case, you can create a virtual directory in your local version of IIS.

  • Your local computer is also your Web server.

Requirements

To create a local IIS Web site requires the following:

  • Your computer must have at least IIS version 5.0 installed and running.

  • Your computer must be running the .NET Framework version 2.0.

  • ASP.NET version 2.0 must be enabled in IIS. For details, see the topic "Enabling ASP.NET" in the IIS Product Documentation.

  • You must be logged in as a user with administrative privileges. This is required because working with the IIS metabase (where information about IIS applications is stored) requires administrative privileges.

To open an existing local IIS Web site, the preceding must be true as well as the following:

  • The site to be opened must be configured as an IIS application. For more information, see the topic "Creating Virtual Directories in IIS 6.0" in the IIS Product Documentation.

  • The site must be configured to use ASP.NET version 2.0. If it is not, when you open the site, Visual Web Developer will prompt you to reconfigure the site to use ASP.NET 2.0. This is distinct from having ASP.NET 2.0 installed on the computer. It is possible to have ASP.NET 2.0 installed on the computer but have the site to be opened still mapped to use an earlier version of ASP.NET.

Creating or Opening Local IIS Web Sites

When you create the Web site, Visual Web Developer performs all of the tasks that are required to make the Web site function as an IIS application. Visual Web Developer creates the folder or folders for your Web site under the Web root for IIS (for example, under \inetpub\wwwroot). After creating folders, Visual Web Developer creates the files for the Web site template that you selected.

Note

You can create an IIS application as a subfolder of any existing IIS folder.

Local IIS Web Site Projects

When you create or open a local IIS Web site, Visual Web Developer creates a project to manage the files. The project stores a small amount of information, such as your choices for how to run the application and what debuggers are available. Project information is stored on a per-user basis. For more information, see Web Site Projects and Solutions.

Running Local IIS Web Sites

By default, when you run a local IIS Web site to test it, Visual Web Developer launches a browser and runs the Web site using the server name localhost. For example, if you have created the Web site ExampleSite, when you test it in Visual Web Developer, the browser will request the test page from this URL:

https://localhost/ExampleSite/page

IIS resolves the application name, whether it points to a folder that is under the IIS root or to another location, and serves pages from that folder.

For more information, see Testing Web Pages in Visual Web Developer.

Deploying Local IIS Web Sites

Local IIS Web sites are generally used only for development, so that individual developers can create and test ASP.NET Web pages on their own computers. In most cases, you must deploy the files from a file system Web site to a production server that is running IIS.

You can deploy the files from a local IIS Web site using the Copy Web tool and the Publish Web utility in Visual Web Developer. For details, see ASP.NET Deployment Overview.

Note

The Publish Web utility is not available in Visual Web Developer Express Edition.

See Also

Concepts

Types of Web Sites in Visual Web Developer

Web Servers in Visual Web Developer