博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SharpSVN出错信息:Can't determine the user's config path,从此证明了百度是个垃圾
阅读量:6414 次
发布时间:2019-06-23

本文共 2374 字,大约阅读时间需要 7 分钟。

 

找了半天没找到问题,从Google一搜就看到了,速度解决之!

Till the beginning of this month, I was a regular SVN user using SVN as my Version Control System for many projects. But then, somewhere in the second week of this month, I have turned a SVN developer (not writing code for SVN itself, but providing solutions off SVN).

For one of the projects code-named Zone, I began writing a module for SVN integration to provide seamless access to local or remote SVN repositories. Without second thought, CollabNet's open-source SharpSvn library was my library of choice for SVN development.

However my first attempt at fetching log from a remote svn repo failed with the following exception:

 

1 SharpSvn.SvnFormatException: Can't determine the user's config path

 

SharpSvn's bundled documentation is good, but not that great. And googling also did not reveal much about this problem. In bits and pieces, I was able to conclude that this exception probably had to do with the missing SVN configuration path (which is a directory for holding run-time configuration information for Subversion clients).

So, do I needed to create this directory or SharpSvn would do it for itself, or is there any specific layout for this directory, etc. were the questions lurking in my mind at that point. One thing that was sure was because the code was executing as a part of ASP.NET application, it cannot and should not use a regular interactive user's Subversion configuration path. And neither should it try to create a new directory somewhere in an interactive user's folders (As a Windows 7 user, my Windows account's Subversion configuration directory is located at: C:\Users\Rahul Singla\AppData\Roaming\Subversion).

Some quick browsing through the SharpSvn's API in Visual Studio's Object Browser, I was able to figure out the LoadConfiguration method on the main SvnClient class. So, the following method call before trying to connect to a remote repo resolved the exception I was getting:

 

 

1 using (SvnClient client = new SvnClient())
2 {
3   client.LoadConfiguration(Path.Combine(Path.GetTempPath(), "Svn"),true);
4 //....More code

 

Here, I am using sub-directory under Windows temporary directory for the ASP.NET application user account's svn configuration path. You might want to use a sub-directory under your application root, or another permanenet folder preferably.

Stay tuned for more SharpSvn blog posts...

转载地址:http://khbra.baihongyu.com/

你可能感兴趣的文章
substr和substring的区别
查看>>
String.Format用法
查看>>
【转】java NiO 学习笔记
查看>>
MySQL的变量查看和设置
查看>>
Android NDK配、编译、调试
查看>>
长平狐 memcached源代码阅读笔记(二):网络处理部分
查看>>
android onNewIntent
查看>>
实战利用腾讯企业邮箱zabbix3.x邮件(微信/QQ/短信)告警详细配置
查看>>
干掉运营商:神奇盒子让你自建GSM 网络
查看>>
配置企业级wlan
查看>>
XML特殊符号
查看>>
kaptcha可配置项
查看>>
JavaMail邮箱验证用户注册
查看>>
系统时间——ntpd
查看>>
反射实现AOP动态代理模式(Spring AOP实现原理)
查看>>
Spring MVC 4.x + fastjson 1.2.7,封装的List<?>参数
查看>>
js选中问题
查看>>
CentOS 7 Shell脚本编程第二讲 Shell 脚本创建和执行
查看>>
protobuf
查看>>
4.Java基础复习--Set
查看>>