views:

379

answers:

1

Hi all I'm trying to create a website that will automate project setup. I want to create SVN directories using SharpSVN. Here's what I tried:

  SvnClient svnClient = new SvnClient();
  svnClient.CreateDirectories(new[]
                               {
                                string.Format("svn://example.com/{0}/trunk/", ProjectName),
                                string.Format("svn://example.com/{0}/branches/", ProjectName),
                                string.Format("svn://example.com/{0}/tags/", ProjectName)
                               });

I get this exception: System.ArgumentException, MESSAGE: This argument is not a valid path. A Uri was specified Parameter name: paths

Also, I don't know where I put in the username & password I want to use?

+1  A: 

You can use SvnClient.RemoteCreateDirectories. (And don't forget to add a log message to the args class, or to handle the Committing event on the Client).

Authentication is handled via the helper class on SvnClient.Authentication. E.g. you could use the .DefaultCredentials on that class. By default SharpSvn falls back on your already cached subversion credentials.

Bert Huijben