4

Trying to use use SharpSVN in an ASP.NET app. So far, it's been nothing but trouble. First, I kept getting permission errors on "lock" files (that don't exist), even though NETWORK SERVICE has full permissions on the directories. Finally in frustration I just granted Everyone full control. Now I get a new error:

OPTIONS of 'https://server/svn/repo': authorization failed: Could not authenticate to server: rejected Basic challenge (https://server)

This happens whether I have the DefaultCredentials set below or not:

using (SvnClient client = new SvnClient())
{
    //client.Authentication.DefaultCredentials = new System.Net.NetworkCredential("user", "password");
    client.LoadConfiguration(@"C:\users\myuser\AppData\Roaming\Subversion");

    SvnUpdateResult result;
    client.Update(workingdir, out result);
}

Any clues? I wish there was SOME documentation with this library, as it seems so useful.

Neil N
  • 24,862
  • 16
  • 85
  • 145
Bryan
  • 8,748
  • 7
  • 41
  • 62

2 Answers2

1

The user you need to grant permission is most likely the ASPNET user, as that's the user the ASP.NET code runs as by default.

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
  • 1
    Answer is in above comments, but going to mark this one correct so Sander gets credit. – Bryan Apr 01 '10 at 21:19
0

ASPNET user is a local account, preferably youd'd want to run this code in an Impersonate block, using a network account set up for this specific reason

Neil N
  • 24,862
  • 16
  • 85
  • 145
  • Is that not what the Authentication.DefaultCredentials are for? Am I using it incorrectly? – Bryan Apr 01 '10 at 21:06
  • 1
    Authentication.DefaultCredentials is for authentication against the repository, the user running the website needs read/write access to `workingDir` – Sander Rijken Apr 01 '10 at 21:08