Troubleshooting the ASP.NET Development Server
The ASP.NET Development Server runs automatically when you test a file-system Web site in Visual Studio. For more information, see Web Servers in Visual Web Developer.
Under some circumstances, working with the ASP.NET Development Server can result in errors. This topic lists situations in which the Web server can produce errors and provides possible remedies.
This error can occur if you are using the ASP.NET Development Server with application-level impersonation and running on Windows Vista with User Account Control enabled.
By default, Windows runs applications in a limited-rights user account even when you are logged on to the computer as an administrator. You must run Visual Studio in the context of an administrator account when running a Web application on Windows Vista using application-level impersonation.
This error can occur if the Web site is configured in the Web.config file to use per-application impersonation (which is impersonation with a fixed account), and if the account running the Web server does not have the Act as Part of the Operating System privilege (also known as the Trusted Computing Base (TCB) privilege). You can configure the Web site to impersonate a specific account by using syntax, such as the following, in the Web.config file.
<identity impersonate="true" userName="<UserName>" password="<secure password>" />
When storing sensitive information such as user names and passwords in a configuration file, you should encrypt the sensitive values using protected configuration. For more information, see How To: Secure Connection Strings when Using Data Source Controls.
The process that launches the ASP.NET Development Server must have the TCB privilege. Therefore, if the Web site is configured to perform impersonation, you must grant the TCB privilege to the account that is running the Web server.
The TCB privilege is very powerful and as a rule, you should grant the TCB privilege to as few accounts as possible. If your Web site is using impersonation and cannot use the ASP.NET Development Server without granting the TCB privilege to the account running the Web server, consider using Internet Information Services (IIS) to test your Web site instead, so that you do not have to grant privileges to an account needlessly.
One possible cause of a 502 error or an error indicating that the page cannot be displayed is that the browser cannot resolve a URL containing "localhost" and a port number, such as http://localhost:8080/ExampleWebSite/Default.aspx. The ASP.NET Development Server works exclusively with localhost, and by default, uses a randomly selected port number for each request.
You might be able to resolve this error by bypassing the proxy server for local requests. For details, see How to: Bypass a Proxy Server for Local Web Requests.
The server reports the following error.
10061 - Connection Refused Internet Security and Acceleration Server
This can occur if the computer is running on a network that is protected with the Internet Security and Acceleration Server (ISA Server) and if either of the following conditions is true:
The firewall client is not installed.
The Web proxy settings in Internet Explorer are configured incorrectly.
This does not occur when working with IIS, because IIS uses port 80, and access to port 80 is allowed by ISA Server and other firewall products. However, the ASP.NET Development Server randomly selects a port, and access to most ports is blocked by firewall products such as ISA Server.
You can avoid this issue in these ways:
Install firewall client software, such as ISA client.
Modify the Web proxy connection settings in Internet Explorer to bypass the proxy server for local addresses.
This error might occur if you are working in a file-system Web application in which the files are on a remote computer. The error occurs as a run-time error when you try to run a page using the ASP.NET Development Server.
You are likeliest to see the error when the remote computer is running Windows 2000 or Windows XP. If the remote computer is running Windows 2000, you can follow the instructions in Microsoft Knowledge Base article 810886 to set the maximum number of concurrent connections to a higher number. If you are running Windows XP, you might be able to avoid this error by closing existing shared resources, including terminal server sessions, on the remote computer. (Windows XP is configured with a fixed number of maximum concurrent network requests.) If practical, you can also copy the Web application files to your local computer and test the application there.
In a file-system Web site, static files, such as images and style sheets, are subject to ASP.NET authorization rules. For example, static files in a file-system Web site will not be served to an anonymous user when anonymous access to those files is disabled. However, when you deploy the Web site to a server running IIS, IIS will serve the static files without using authorization rules.