Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

I got this error (and serveral variations of it while trying to fix it) when trying to open an ASP.NET (.Net 1.1) web app in VS.NET (2003) (on an XP Pro box):

Unable to open Web Project 'TestW'. The file path 'C:\inetpub\wwwroot\TestW' does not correspond to the URL 'http://Localhost:/TestW'.  The two need to map to the same server location.  HTTP Error 403: Access Forbidden

This was caused by two problems:

  1. I had added a certificate to the server (IIS 5) - and the cert specified my full machine domain name.
  2. I had changed the web app's security setting to 'Require secure channel (SSL)'.

To resolve this I had to do the following:

  1. Remove the offending web app project from the VS.NET solution & save the solution.
  2. Using a test editor (eg Notepad), open the .webinfo file of the offending project (eg C:\Inetpub\wwwroot\TestW\TestW.csproj.webinfo).
  3. Update the 'URLPath' attribute of the 'Web' element to use the full host name (required for cert) and to use https (required for SSL) eg:
    Replace this:
    <Web URLPath = "http://localhost/TestW/TestW.csproj" />
    With this:
    <Web URLPath = "https://iblongsw70991.gb.ad.drkw.net/TestW/TestW.csproj" />
  4. Save the webinfo file.
  5. Within VS.Net, right-click on the solution and select Add - Existing Project From Web....
  6. Enter the new URL, identical to what you just saved in the webinfo file.  Eg:  
    https://iblongsw70991.gb.ad.drkw.net/TestW/TestW.csproj
  7. Save it all and cross your fingers ;-)

HTH

Tim

Posted on Thursday, September 8, 2005 12:16 PM C# .NET , ASP.NET | Back to top


Comments on this post: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
Hi tim,

That was a good "on the trivia" article. Saved me a lot of time. Thanks.

Cheers

Lavanya
Left by lavanya on Sep 20, 2005 7:11 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 404: Not found
Requesting Gravatar...
Hi !
can anyone solve this...its a Error 404 and iam not able to open the solution at all to find the web.config file
Left by Sarath on Oct 19, 2005 5:09 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
EXCELLENT!! I worked great. I wanted to know this so that I can open different versions of the same project. Otherwise if you create project1 and project2 in IIS, but the both map to project1, you will not be able to open project2. The error shows up. This fix is great! Thank you for posting
Left by ag on Mar 02, 2006 12:45 PM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
This article offers another solution:
http://www.mredkj.com/vbnet/UnableToOpenWebProject.html
Left by Austin on Apr 21, 2006 2:15 PM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
Hi !
can anyone solve this...its a Error 404 and iam not able to open the solution at all to find the

regarda
vijay rk
Left by R K Vijay on Jun 20, 2006 3:46 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
Read this, it works for me. I do need to delete the sln thou.

http://www.mredkj.com/vbnet/UnableToOpenWebProject.html
Left by Camb on Jun 20, 2006 7:17 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
After trying this also i am unable to add the project . Please help me ASAP.
Left by Rajyalakshmi on Oct 05, 2006 5:59 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
If you're using SBS 2003, this is your problem: You need to add .tmp as a mime type.

http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=57
Left by Dan on Oct 05, 2006 1:49 PM

# Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 404: Object Not found
Requesting Gravatar...
hi, still i can not solve this problem. can anyone send me a reply please.
Left by Mahmod on Nov 12, 2006 3:49 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
Hi Mahmod

There could be a heap of problems that cause this - I think the easiest way around it is to create a new solution and ASP.NET project - then just simply copy the files across from the original.

Let me know how you get on.

Cheers
Tim
Left by Tim Huffam on Nov 12, 2006 6:59 PM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
the webserver reported following error when attempting to create or open the web project located at the follwoing url:http:''//localhost/webapplication1'. the server returned an invalid or unrecognized error

I am getting this error
does anybody has solution to this problem...
Left by swatantra on Feb 15, 2007 9:26 AM

# My problem
Requesting Gravatar...
the webserver reported following error when attempting to create or open the web project located at the follwoing url:http:''//localhost/webapplication1'. the server returned an invalid or unrecognized error
Left by swatantra on Feb 15, 2007 9:27 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
Delete your cache from C:\Documents and Settings\[User Name] - that usually solves the problem (although you might want to backup your code somewhere else first).
Left by Alex on Feb 23, 2007 9:47 AM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
Hi Tim,

Great solution man. Thanks a lot.
Left by sid on Mar 15, 2007 12:03 PM

# re: Unable to open Web Project '...'. The file path '...' does not correspond to the URL '...'. The two need to map to the same server location. HTTP Error 403: Access Forbidden
Requesting Gravatar...
try turning off windows firewall!!!or allowing your web address, worked for me
Left by greg chow on Apr 10, 2007 2:46 AM

# Connecting to the server unable to open
Requesting Gravatar...
I bought one dot net books and in that, the source code cd was attached. I am trying to open that file it will display the following error message,

Connecting to the server and check the proxy setings and the path. What is the reason? how can i open and run that project?
Left by Baskar on Jul 06, 2009 12:20 PM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net | Join free