Thursday, September 01, 2011

What to do when VS 2010's Website 'Copy Website' tool does not work.

I had this annoying problem: every time I'd open up VS.NET 2010, open up a website project, and use the 'Copy Website' feature, I would have to re-setup my connection. It never saved my settings, copied files, etc. I ended up doing the following to resolve the problem.

In Windows XP, delete everything in your %HOMEDRIVE%\%HOMEPATH%\Local Settings\Application Data\Microsoft\WebsiteCache directory.

That did it for me!

However, the problem can recur if VS.NET creates a project folder in that directory that conflicts with another. For example, in my case, I typically call my website projects WebUI. Using the copy tool will sometimes overwrite those folders, creating a problem. This is why I now edit the Websites.xml file to ensure that each CacheFolder is unique and does not clash with other website projects containing the same name (e.g., from WebUI to MyProject1WebUI).