VisualSVN和TortoiseSVN在提交C#代码文件时出错400

时间:2014-03-07 16:27:17

标签: c# svn tortoisesvn visualsvn

我在办公室局域网中设置了Subversion机器。 Subversion由Apache提供。

然后我启动了一个Java项目,并从CVS(所有Java项目!)执行了一些迁移。一切运行良好,我可以使用Subversive清楚地使用Eclipse中的SVN。

然后我开始了我们的第一个C#项目。当它提交给Subversion时,当Tortoise(由VisualSVN驱动或使用独立)尝试上传.cs文件时,我总是会收到400错误

TortoiseSVN版本信息(截至今天,它是最新的):

TortoiseSVN 1.8.5, Build 25224 - 64 Bit , 2014/02/18 20:05:11↩⏎
Subversion 1.8.8, -release↩⏎
apr 1.5.0↩⏎
apr-util 1.5.3↩⏎
serf 1.3.4↩⏎
OpenSSL 1.0.1f 6 Jan 2014↩⏎
zlib 1.2.8

这是TortoiseSVN日志(部分本地化):

Errore: Commit fallito (seguono dettagli):  
Errore: Unexpected HTTP status 400 'Bad request' on  
Errore:  '/svnroot/cst/!svn/txr/21-y/path/to/trunk/XsdValidationService/XmlValidationResult.cs'  
Errore: Additional errors:  
Errore: PUT of  
Errore:  '/svnroot/cst/!svn/txr/21-y/path/to/trunk/XsdValidationService/XmlValidationResult.cs':  
Errore:  400 Bad request  

这是Apache配置

默认-server.conf中

<Location /svnroot/repo>
  DAV svn
  SVNPath /srv/svn/repos/repo
  SVNAutoversioning On
  # Repository Display Name
  SVNReposName "SVN Repository"

  #SecFilterEngine off

  #Authorization
  # Do basic password authentication in the clear
  AuthType Basic

  # The name of the protected area or "realm"
  AuthName "CompanyName"

  # Make LDAP the authentication mechanism
  AuthBasicProvider ldap

  # Active Directory requires an authenticating DN to access records
  AuthLDAPBindDN []

  # This is the password for the AuthLDAPBindDN user in Active Directory
  AuthLDAPBindPassword []

  # The LDAP query URL
  AuthLDAPURL []

# Require a valid user
  Require valid-user
  AuthUserFile /dev/null

  allow from all
</Location>

这是Apache访问日志

192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "MKCOL /svnroot/cst/!svn/txr/21-w/path/to/project/XsdValidationService HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "MKCOL /svnroot/cst/!svn/txr/21-w/path/to/projectProperties HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "MKCOL /svnroot/cst/!svn/txr/21-w/path/to/projectSchemas HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PROPPATCH /svnroot/cst/!svn/txr/21-w/path/to/project/XsdValidationService HTTP/1.1" 207 491 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PROPPATCH /svnroot/cst/!svn/txr/21-w/path/to/project HTTP/1.1" 207 470 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PUT /svnroot/cst/!svn/txr/21-w/path/to/project/EDWin.sln HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PUT /svnroot/cst/!svn/txr/21-w/path/to/projectSchemas/ED-AUTO-1-0.xsd HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PUT /svnroot/cst/!svn/txr/21-w/path/to/projectSchemas/ED-ACC-SME-1-0.xsd HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PUT /svnroot/cst/!svn/txr/21-w/path/to/projectSchemas/ED-RMBS-1-7.xsd HTTP/1.1" 201 71 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:09 +0100] "PUT /svnroot/cst/!svn/txr/21-w/path/to/projectXmlValidationResult.cs HTTP/1.1" 400 5268 "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"
192.168.0.167 - [USERNAME] [07/Mar/2014:17:20:10 +0100] "DELETE /svnroot/cst/!svn/txn/21-w HTTP/1.1" 204 - "-" "SVN/1.8.8 (x64-microsoft-windows) serf/1.3.4 TortoiseSVN-1.8.5.25224"

错误日志中没有显示错误。

我注意到如果Tortoise由于某种原因以不同的顺序提交文件,那么只有第一个.cs会导致麻烦。我还没有实现任何过滤钩子脚本。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

标准default-server.conf包含以下指令(以及注释):

# Include all *.conf files from /etc/apache2/conf.d/.
#
# This is mostly meant as a place for other RPM packages to drop in their
# configuration snippet.
# 
# You can comment this out here if you want those bits include only in a
# certain virtual host, but not here.
#
IncludeOptional /etc/apache2/conf.d/*.conf

在我的openSUSE 13.1安装中,Apache附带了Mono。虽然mod_mono/etc/sysconfig/apache2命令)中未加载a2dismod mono,但/etc/apache2/mod_mono.conf始终加载Mono运行时并将.cs个文件关联到Mono。< / p>

现在,当我提交带有.cs扩展名的C#代码文件时,默认情况下Apache允许Mono处理这些请求,这最终导致以下异常只能使用Wireshark捕获:

[System.ArgumentException]: Directory does not exists
Parameter name: value

  at System.IO.FileSystemWatcher.set_Path (System.String value) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileSystemWatcher:set_Path (string)
  at System.Web.HttpRuntime.SetupOfflineWatch () [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime.Process (System.Web.HttpWorkerRequest req) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime.RealProcessRequest (System.Object o) [0x00000] in <filename unknown>:0 
  at System.Web.HttpRuntime.ProcessRequest (System.Web.HttpWorkerRequest wr) [0x00000] in <filename unknown>:0 
  at Mono.WebServer.MonoWorkerRequest.ProcessRequest () [0x00000] in <filename unknown>:0 

Subversion请求中的ASP.NET异常闻起来很难让我调查

最终

我只是注释掉了上面的Apache指令并提交了没有问题。