Wednesday, November 14, 2007

Can't open Visual Studio 2003 Web Application?

I was trying for quite a long time to work out why I couldn't open a Visual Studio 2003 website and kept receiving an error along the lines of:

Web Access Failed - 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 '\\localhost\wwwroot$\'.

The error returned was:

Unable to create Web project 'WebApplication1'. The file path
'D:\Projects\WebProject1' does not correspond to the URL 'http://localhost/'.
The two need to map to the same server location. HTTP Error 404 : Not Found


After some searching online I realised I needed to create a UNC share to the root directory of my website and specify that share when the project opens. 'Administrators' and 'VS Developers' need full control of the share.

This got around the 'Web Access Failed' error. However, this is when the pain started. I was then confronted with:

Unable to Retrieve Folder Information from the Server

So, my project was still unavailable. I went through numerous steps to try and fix this issue, but nothing worked. Finally, I found an obscure post mentioning that you should avoid folders prefixed with '.' with Visual Studio as it can cause problems. This was right on the mark! Because I use Subversion and TortoiseSVN for my source control, my tree was littered with hidden '.svn' folders. It turns out that the creation of Subversion also came across this issue, as there is an option in the settings to use '_svn' instead of '.svn'. Once I changed this setting, deleted the folder and re-got the files from source control everything worked perfectly. In short, what out for folders with a period as a prefix when using Visual Studio!

0 comments:

Post a Comment