zoukankan      html  css  js  c++  java
  • SharpSVN出错信息:Can't determine the user's config path,从此证明了百度是个垃圾

    找了半天没找到问题,从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...

  • 相关阅读:
    第三周学习进度条
    绘制echarts折线图
    第二周学习进度条
    返回一个整数数组中最大子数组的和
    软件工程第二周开课博客
    第一周学习进度条
    学习进度
    学习进度
    学习进度
    HDU 4906 (dp胡乱搞)
  • 原文地址:https://www.cnblogs.com/goody9807/p/2853182.html
Copyright © 2011-2022 走看看