Microsoft KB Archive/326497

= PRB: &quot;Unable to Open Web Project&quot; Error Message If the Web Project Is Moved to Another Computer =

Article ID: 326497

Article Last Modified on 7/8/2003

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft ASP.NET 1.0
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Professional Edition

-



This article was previously published under Q326497



SYMPTOMS
If you use Microsoft Visual Studio .NET to open a solution file (.sln), and the solution file contains a Web project that was developed on a computer other than the computer that you are currently working on, you receive the following error message:

The default Web access mode for this project is set to file share, but the project folder at http://LocalHost/ cannot be opened with the path '. The error returned was:

Unable to open Web project. The Web  located on server http://localhost does not exist.

What would you like to do?

Retry using a different file share path

Try to open the project with FrontPage Server Extensions

Work offline

If you click Cancel, you receive the following error message:

Unable to open Web project. The Web  located on server http://localhost does not exist.

After Visual Studio .NET opens the solution file, the project is marked unavailable.

However, if you try to directly open the Web project file (.csproj or .vbproj) instead of the solution file, you receive the following error message:

Unable to open Web project. The file path  does not correspond to the URL http://Localhost:/projectname. The two must map to the same server location. HTTP Error 404: Object Not Found.

If you click OK, the project is not open.



CAUSE
This behavior may be caused by incorrect configuration of the project or of the virtual directory on the target computer (the computer on which you are trying to open the project files and the solution files).



RESOLUTION
To open the Web project with Visual Studio .NET, follow these steps:
 * 1) In Internet Services Manager, create a virtual directory (named &quot;Test,&quot; for example). This virtual directory must point to the folder that contains the application content, including the project file.

For more information, see the &quot;References&quot; section of this article.
 * 1) Open the WebInfo file ( .vbproj.webinfo or  .webinfo) with any text editor, such as Notepad. The WebInfo file is part of the application content.
 * 2) Make the URLPath attribute the location of the project file (for example, http://localhost/ / .vbproj or http://localhost/Test/test.csproj).
 * 3) Save the WebInfo file.
 * 4) Use Visual Studio .NET to open the project file (.csproj or .vbproj), and then save the new solution.

NOTE: Steps 2, 3, and 4 can be circumvented. To circumvent these steps, create a virtual directory structure that mimics the structure of the computer on which the Web project was developed. For example, if the project name is MyApp, and the project is located two levels below the Default Web Site in Microsoft Internet Information Server (IIS) in the virtual directory named MyApp (/Apps/DB/MyApp), you must re-create this structure on the local IIS computer.



STATUS
This behavior is by design.



MORE INFORMATION
The WebInfo file (Projectname.csproj.webinfo or Projectname.vbproj.webinfo) is part of the project content created by Visual Studio .NET. The WebInfo file keeps track of the virtual root location of a project. It contains a URL whose path specifyies the location of the project files.

