2015-04-02 86 views
0

我建立了一個連接到SVN存儲庫的應用程序,它使用我的憑證和我的SVN訪問URL,但是當我更改用戶和它無法工作的URL時。
的例外是:sharpSVN連接到一些存儲庫和其他沒有

SharpSvn.SvnRepositoryIOException //Unable to connect to a repository at URL 

我檢查了其他用戶的瀏覽器上訪問和它的作品,但在我的應用程序沒有!即使使用管理員的密碼,它也只能與我的SVN訪問URL一起工作。 當我改變SVN它產生異常,不返回任何東西

client.GetList(repo, out list); // list is null 

請幫我解決這個問題的URI。

+0

顯示一些代碼,顯示如何連接到遠程存儲庫並指出哪個語句失敗。 – RenniePet 2015-04-02 08:35:03

+0

請檢查整個錯誤鏈(例如,對異常使用.ToString())。在內部錯誤/異常中,Subversion提供了比這更多的錯誤細節。 – 2015-04-02 13:06:25

+0

sharpSvn.SvnRepositoryIOForbiddenException 無法連接到存儲庫URL URL https://svn.mysvn-apps.com/svn/PFE-DirDev-KPN/ – AtefB 2015-04-02 14:20:40

回答

0
Uri url = new Uri("https://svn.mysvn-apps.com/svn/PFE-DirDev-KPN/"); 

client.Authentication.DefaultCredentials = new NetworkCredential("user", "password"); 
     client.Authentication.SslServerTrustHandlers += delegate(object sender, SvnSslServerTrustEventArgs e) 
     { 
      e.AcceptedFailures = e.Failures; 
      e.Save = true; 
     }; 


Collection<SvnListEventArgs> list; 
SvnUriTarget repo = new SvnUriTarget(url); 

try 
{ 
    client.GetList(repo, out list); // here generates the exception 
} 
catch (Exception e) 
{ 
    // Do this or write e.ToString() to a log file or examine e in the Visual Studio debugger 
    Console.WriteLine(e.ToString()); 
} 
+0

你不應該發佈額外的信息作爲答案,你應該編輯你的問題並在那裏添加代碼。 – RenniePet 2015-04-02 16:05:48

+0

無論如何,我修改了你的代碼,向你展示了@BertHuijben的建議;通過將.ToString()應用於異常,可以從異常中獲得更多信息。 Bert暗示在異常的「InnerException」字段中可能有有意義的信息。 – RenniePet 2015-04-02 16:07:44

+0

正在構建的項目「MSIL」的處理器體系結構與參考「SharpSvn」,「x86」的處理器體系結構之間存在不匹配。這種不匹配可能會導致運行時故障。請考慮通過配置管理器更改項目的目標處理器架構,以便使其處理器架構項目和引用之間,或者採取與該項目的目標處理器架構匹配的處理器架構引用的依賴。 – AtefB 2015-04-03 08:16:11

相關問題