Rob Chartier ~ Contemplation...

.NET, C#, Work, etc.

News

www.flickr.com
This is a Flickr badge showing public photos from Rob & Kat Chartier. Make your own badge here.


Website Counter

Even Quicker Links

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:

http://tortoisesvn.tigris.org/files/documents/406/24266/TortoiseSVN-1.2.1.3897-VS.NET-ASP.NET-svn-1.2.1.msi

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.

 

Posted: Aug 10 2005, 02:32 PM by Rob Chartier | with 9 comment(s)
Filed under:

Comments

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.
# August 10, 2005 8:44 PM

Jeff Gonzalez said:

I think the better plan of action would be to change your project to a class library and use the url debugging option. Then you don't have to worry about this problem at all. ( you can change web projects to class libraries by opening the project file and changing the type from "web" to "local"....You will also need to make your solution reference the project file by path instead of http://. The last thing you need to do is remove the .webinfo file altogether.)

You can enable asp.net debugging in the same place you choose to use a url instead of project debugging. I believe it can be found in the properties > debugging area of the project.

This makes the project much more portable across machines with different configurations (such as XP professional or Windows Server 2003).
# August 11, 2005 1:41 AM

Ricky Dhatt said:

We had the same problem, and solved it by not using ASP. NET web projects. You just use a library project instead. I now prefer not using web projects. Plus I can't give up the svn and-line client.

See http://pluralsight.com/wiki/default.aspx/Fritz/AspNetWithoutWebProjects.html for details.
# August 11, 2005 3:01 AM

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
# August 12, 2005 6:21 AM

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.
# August 18, 2006 1:26 PM

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.

# January 12, 2007 10:03 AM

Clint's Blog said:

# May 29, 2007 11:29 AM

billie said:

Thanks for the info, helped me fix that vague problem

# July 6, 2007 5:02 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)