How to use SharpSVN in ASP.NET?

An attempt to use SharpSVN in an ASP.NET application. So far, this has been just a problem. First, I continued to receive permission errors for "locked" files (which do not exist), although NETWORK SERVICE has full permissions on directories. Finally, disappointed, I just gave everyone complete control. Now I get a new error:

OPTIONS ' https: // server / svn / repo ': authorization failed: server authentication failed: rejected main call ( https: // server )

This will happen if I set DefaultCredentials 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 documentation in this library because it seems so useful.

+4
source share
2 answers

The user who needs to be granted permission is most likely an ASPNET user, because the user runs ASP.NET code by default.

+1
source

An ASPNET user is a local account, it is advisable that you run this code in the Impersonate block using the network account configured for this specific reason.

0
source

Source: https://habr.com/ru/post/1305804/


All Articles