如何在ASP.NET中使用SharpSVN?
尝试在 ASP.NET 应用程序中使用 SharpSVN。到目前为止,除了麻烦之外什么也没有。首先,即使 NETWORK SERVICE 对目录具有完全权限,我仍然收到“锁定”文件(不存在)的权限错误。最后,我沮丧地授予每个人完全控制权。现在我收到一个新错误:
OPTIONS of 'https://server/svn/repo': 授权失败:无法对服务器进行身份验证:拒绝基本质询 (https://server)
无论我是否设置了以下 DefaultCredentials,都会发生这种情况:
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);
}
有什么线索吗?我希望这个库有一些文档,因为它看起来很有用。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要授予权限的用户很可能是 ASPNET 用户,因为这是 ASP.NET 代码默认运行的用户。
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.
ASPNET 用户是本地帐户,最好您希望使用为此特定原因设置的网络帐户在模拟块中运行此代码
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