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...

  • 相关阅读:
    mysql 初始密码 设置
    jsp基础知识(基本的语法及原理)
    hdu 2473 Junk-Mail Filter (并查集之点的删除)
    java版本的学生管理系统
    java操作数据库出现(][SQLServer 2000 Driver for JDBC]Error establishing socket.)的问题所在即解决办法
    Java学习之约瑟夫环的两中处理方法
    hdu 3367(Pseudoforest ) (最大生成树)
    hdu 1561 The more, The Better (树上背包)
    Nginx + Lua 搭建网站WAF防火墙
    长连接和短连接
  • 原文地址:https://www.cnblogs.com/goody9807/p/2853182.html
Copyright © 2011-2022 走看看