The ASP. NET project prompts that the Web project cannot be opened to solve the problem.

Source: Internet
Author: User

Fault symptom:

When you open an ASP. NETWeb project, the following error occurs:
Prompt window title: Web Access failed
Note: The default Web access mode of this project is file sharing, but the project folder in "..." cannot be opened from the path. The returned error is: The Web project "" cannot be opened. The returned error is: The Web project "..." cannot be opened. The file path "..." contains the URL "..." does not match. The two must be mapped to the same server location. HTTP Error 404: NotFound ......

Solution:

Go to "C: \ DocumentsandSettings \ your USERNAME \ Visual StudioWebCache \ computer name \" and delete the folder with the same name as this project.

Analysis:

When you create an ASP. visual Studio. NET will automatically create a folder with the same name as the project in Visual StudioWebCache (if such a folder already exists, Visual Studio. and create a file (project name) in the folder. csproj. user) and ASP. copies of all directories in the NETWeb project (the copy is an empty directory and does not contain any files ).

When you open ASP. NETWeb project, Visual Studio. NET will read the folder in Visual StudioWebCache with the same name as this project, if the ing path of the folder in Visual StudioWebCache and this ASP. the preceding error message is displayed when the NETWeb project is different. In this case, you can solve the problem only by deleting the folder with the same name in Visual Studio webcache and re-creating Visual Studio. NET.

TIPS:

1. Visual StudioWebCache is used to support offline development of ASP. NETWeb applications. Assume that you have implemented ASP on a WEB server.. NET project development. For some reason, you can only perform offline development on your laptop. In this case, you can use Visual Studio.. NET. Open this project on your laptop. in Visual Studio. NET, select "project" = "Web project" = "offline work ". Visual Studio. NET copies all project files to Visual Studio webcache. In this way, you can open the project file in Visual StudioWebCache offline for development. When online, select "project" = "Web project" and select "Synchronize all folders" to copy the content developed offline to the server.

2. Visual Studio. NET uses FrontPageserverextensionsg to communicate with the Web server, Visual Studio.. NET cannot directly modify files on the Web server, so Visual Studio. NET uses Visual StudioWebCache as a transfer station. It first places the edited and compiled files in Visual StudioWebCache, and then uploads the files to the server through FrontPageserverextensionsg.

Note: The information in the prompt window popped up by Visual Studio. NET cannot be copied by pressing Ctrl + C.

Http://www.ftponline.com/Visual Studiom/2003_01/online/hottips/kiely/default. aspx

If the problem persists!

Check whether the virtual directory exists and its direction exist in the settings in IIS. Open the. sln file in notepad, write the virtual directory behind localhost, save it, and then open it with Visual Studio. If the problem persists, name web. config _ web. config and use Visual Studio to open the project.


The virtual directory name you set must be the same as the original virtual directory name of the project, or change the URLPath value to the virtual directory name you are currently using in the. csproj. webinfo file.

If the above method still cannot be solved, try the following method.

In Visual Studio. NET, to test URL and UNC, Visual Studio. NET generates a. tmp file under the directory, and then sends a request to the file through HTTP. But in IIS6, for security reasons, the tmp file is not registered. By default, it will be block and then generate an HTTP404 error.

To solve this problem, see the following method:

1. Open the IIS manager.

2. Right-click DefaultWebSite and select Properties.

3. Click "HttpHeader ".

4. Click "MIMETypes ".

5. Click "New ".

6. In Extension, enter ". tmp". (No quotation marks are required)

7. In MIMEType, enter "Temp". (No quotation marks are required)

Another solution is to use the following command line:

% Systemdrive % \ inetpub \ adminscripts \ adsutil. vbssetw3svc/1/root/MimeMap. tmp, temp

When creating a WebApplication, Visual Studio. Net needs to create a temporary file named. tmp in the Creation Path.
After Visual Studio. Net creates a project, it will seek project files from the Web folder in HTTP mode and temporary files. Because IIS does not set the. tmp file as the MIME type in some installation steps of windows2003, IIS returns an unknown file type error to Visual Studio. Net, that is, the file cannot be found. Therefore, Visual Studio. Net considers that your IIS path settings are incorrect.

If the problem persists, reconfigure IIS.

  1. ASP. NET naming settings
  2. ASP. NET control usage tips
  3. Analysis on ASP. NET technique to improve application performance
  4. Use of StringBuilder class in ASP. NET skills
  5. Analysis of data collection procedures using ASP. NET Techniques

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.