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:
- I had added a certificate to the server (IIS 5) - and the cert specified my full machine domain name.
- I had changed the web app's security setting to 'Require secure channel (SSL)'.
To resolve this I had to do the following:
- Remove the offending web app project from the VS.NET solution & save the solution.
- Using a test editor (eg Notepad), open the .webinfo file of the offending project (eg C:\Inetpub\wwwroot\TestW\TestW.csproj.webinfo).
- 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:
<Web URLPath = "http://localhost/TestW/TestW.csproj" />
<Web URLPath = "https://iblongsw70991.gb.ad.drkw.net/TestW/TestW.csproj" />
- Save the webinfo file.
- Within VS.Net, right-click on the solution and select Add - Existing Project From Web....
- Enter the new URL, identical to what you just saved in the webinfo file. Eg:
- Save it all and cross your fingers ;-)