VS.NET - ASP.NET - Tip - Unable to open web project

Unable to open web project Error description and solution


A common problem when first working with VS.net and ASP.NET is this error:

Unable to open web project 'somepath'.
The file path does not correspond to the URL
'someurl'. The two need to map to the
same server location. Http error 404: Not Found.

The issue is quite likely that certain VS.NET files are not pointing to the location of the web server directory/ virtual directory for the web application. There are two files that have setting for this information:

1. The .webinfo file which is based on the project name (WebUI.vbproj would have a webinfo file named WebUI.vbproj.webinfo)
2. The solution(.sln) file.

Both must point to the web application location.

If both files are pointing to the correct location on the webserver and you are still receiving the error you may need to delete the solution's User Option File. For some reason this stores information about the web application location, and it is not reset after updating the solution and webinfo files. This file is located in the same directory as the solution file with a .suo extension. Once this file is deleted, you should be able to start up the solution containing the web project without the "unable to open web project error".

File Examples:

	-If your web application is located at http://localhost/Testing
	Your solution file should contain an entry similar to this:

	Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WebApp", "http://localhost/Testing/WebApp.vbproj",
		ProjectSection(ProjectDependencies) = postProject

        Your webinfo file should look like this:
        	<Web URLPath = "http://localhost/Testing/WebApp.vbproj" />

About this page: