2015-09-25 89 views
0

SharpSVN連接問題我有下面的代碼使用SharpSVN在VB.NET

AddHandler SVNclient.Authentication.SslServerTrustHandlers, Sub(ssender As Object, ev As SharpSvn.Security.SvnSslServerTrustEventArgs) 
                     ev.AcceptedFailures = ev.Failures 
                     ev.Save = True 
                    End Sub 

SVNclient.Authentication.ForceCredentials("user", "password") 

當我在本地執行訪問SVN,我沒有問題。當我把它部署到我們的測試服務器,我收到以下錯誤

Unable to connect to a repository at URL 'https://....' 

我能夠連接到服務器上使用TortoiseSVN回購。

有沒有人有任何想法如何解決這個問題?如果可能,我寧願不必強制憑據。

提前致謝!

回答

0

這個工作對我來說:

 svnClient.LoadConfiguration(Path.Combine(Path.GetTempPath(), "Svn"), True) 
     svnClient.Authentication.Clear() 

     AddHandler svnClient.Authentication.SslServerTrustHandlers, Sub(ssender As Object, ev As SharpSvn.Security.SvnSslServerTrustEventArgs) 
                         ev.AcceptedFailures = ev.Failures 
                         ev.Save = True 
                        End Sub 

     svnClient.Authentication.DefaultCredentials = New NetworkCredential("user", "pass")