Subversion & ASP.NET Projects Bug Fix
So VS.NET is giving you the vague error when using Subversion to version control your ASP.NET Web projects.
"Refreshing the project failed. Unable to retrieve folder information from the server"
Here is a good working solution, its not my solution but I felt the need to document it and to share.
First off, uninstall your version of TortoiseSVN. You installed the version which produces that standard ".svn" folders which is the reason for this issue in the first place.
Next, download and install the special version specific to VS.NET. At the time of writing this the proper download was indicated by:
"Special version for Win2k/XP: (We provide NO support for this!) uses _svn folders instead of .svn to work around the VS.NET bug with web projects. If you don't use web projects then please use the official version. Note: working copies created by this version are incompatible with other Subversion clients!"
And was found at:
So great, you now have changed over your version of TortoiseSVN to use the _svn instead of the common .svn folders, but what about all of your local code which you may or may not have commited the changes to your repository, or plain and simple you want an easier way to update your local copy to avoid having to get it all from the repository again?
Here is a quick snippet of code that I threw together just for this purpose:
using System;
namespace SVNChangeFolders {
class Class1 {
[STAThread]
static void Main(string[] args) {
string source=".";
string dest="_";
string path = "";
foreach(string a in args) {
if(a.ToLower()=="to:_" || a.ToLower()=="to:.") {
if(a.ToLower()=="to:_") {
source=".";
dest="_";
} else {
source="_";
dest=".";
}
}else{
path+=" "+a.Trim();
}
}
path=path.Trim();
if(!System.IO.Directory.Exists(path)) {
System.Console.WriteLine("Folder does not exist:"+path);
return;
}
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(path);
RenameFolders(dir.GetDirectories(),source, dest);
}
public static void RenameFolders(System.IO.DirectoryInfo[] Folders, string source, string dest) {
foreach(System.IO.DirectoryInfo dir in Folders) {
if(dir.Name==source+"svn")
dir.MoveTo(dir.FullName.Replace(source+"svn",dest+"svn"));
else {
RenameFolders(dir.GetDirectories(),source, dest);
}
}
}
}
}
Useage is pretty easy, build it first with:
"csc SVNChangeFolders.cs"
then run it:
SVNChangeFolders Some Directory Path
or
SVNChangeFolders "Some Directory Path"
By default it will switch all ".svn" folders to "_svn". You can change this behaviour by doing something like:
SVNChangeFolders Path to:.
or
SVNChangeFolders Path to:_
Pretty simple fix and much easier than gettting the latest revision of the (sometimes large) tree.
6 Comments
Comments have been disabled for this content.
Kyle said
That's hardly a fix, it's a horrible workaround to a problem that Microsoft should just fix. It's a known bug, and it is a bug, not an issue with Subversion.
Damien Guard said
While I too use the class library hack you can also switch AnkhSVN to use _svn instead by simply editing it's config file :)
[)amien
Scott Hanselman said
Tortoise 1.2 is quite old. 1.3 had an installer option for this, and 1.4 puts that option in the setting dialog.
justme said
The following worked for me. It might also work for some people: 1. search for ".svn" folders (make sure to tick the hidden files and folders checkbox - from the "more advanced options"). 2. delete all .svn folders! 3. install Tortoise version 1.2 and checkout a fresh version of your web projects. 4. replace the new checked-out folder with your older one replacing the new files with your own (modified) ones.
billie said
Thanks for the info, helped me fix that vague problem
Ramanathan Ramasamy said
Ya i found it is fixed thanks