无法将几个文件从Visual Studio项目提交到subversion

时间:2017-09-16 12:55:29

标签: visual-studio iis svn visualsvn

几个星期以来,我在Subversion方面遇到了一些问题。当我尝试从Visual Studio 2017项目提交文件时,有一些文件我无法提交到我的Visual SVN服务器。准确地说,项目文件夹中的所有文件,如* .cs,*。config,* .csproj,* .resx,......

我的设置:
客户:Windows10上的TortoiseSVN 1.9.7 服务器:在Windows Server 2012r2上运行的IIS-ReverseProxy后面的VisualSVN

当我尝试提交例如* .cs文件时出现的错误:

Commit
D:\Test\branches\ScaraControl\ScaraControl\Form1.cs
D:\Test\branches\ScaraControl\ScaraControl\Form1.cs
Commit failed (details follow):
File 'D:\Test\branches\ScaraControl\ScaraControl\Form1.cs' is out of date
'/svn/Test/!svn/txr/5-9/branches/ScaraControl/ScaraControl/Form1.cs' path not found
You have to update your working copy first.

更新工作副本已成功完成,但无法解决问题。

您可以在下面的图片中看到我的项目。为了测试,我创建了一个全新的空库。正如您所看到的,.vs,bin和obj文件夹被忽略,其中包含所有文件,所有其他文件夹都被提交到服务器(没有文件内部的文件)。在第二张图片中,您可以看到我可以提交* .sln文件,但项目文件夹中没有其他文件。

enter image description here enter image description here

为了测试,我创建了一个空文本文件并将其重命名为text.cs.即使这个空文件也无法使用相同的错误消息提交给服务器。

由于所有客户端都发生了这种情况,我认为它更可能是服务器端的问题,但我不知道是什么原因导致此错误。不幸的是,VisualSVN Server没有错误记录,或者至少没有我使用的免费版本。

我非常感谢能够解决这个令人讨厌的问题的任何提示。

编辑1:问题是由IIS反向代理

引起的

通过端口8443直接连接到VisualSVN服务器(绕过反向代理)后,一切正常。因此,URL Rewrite模块的配置一定存在问题。说实话,我花了很长时间才能让它以某种方式工作,因为我对所有设置的了解非常有限。

这是我的Web.config,其中包含URL Rewrite模块的设置。也许有一些未配置的东西应该是。如果您需要更多信息,请询问。

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" enabled="true">
                    <match filterByTags="A, Form, Img" pattern="^http(s)?://svn.example.org:8443/(.*)" />
                    <action type="Rewrite" value="http{R:1}://svn.example.org/{R:2}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
            <rules>
                <rule name="ReverseProxyInboundRule1" enabled="true" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{CACHE_URL}" pattern="^(https?)://" />
                    </conditions>
                    <action type="Rewrite" url="{C:1}://svn.example.org:8443/{R:1}" />
                </rule>
            </rules>
        </rewrite>
        <security>
            <authorization>
                <remove users="*" roles="" verbs="" />
                <add accessType="Allow" users="" roles="Users" />
                <add accessType="Allow" users="*" />
                <add accessType="Allow" users="?" />
            </authorization>
        </security>
        <urlCompression doStaticCompression="false" doDynamicCompression="false" />
        <httpRedirect enabled="false" destination="https://svn.example.org" exactDestination="true" childOnly="true" />
        <directoryBrowse enabled="false" />
    </system.webServer>
</configuration>

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题,我正在通过IIS运行反向代理,所以相信它与它有关。

VisualSVN在https://localhost:8443本地提供,我试图使用反向代理从https://svn.mysite.com路由。此出现以正常工作。您甚至可以签出一份新的repo副本,并下载所有文件。当您尝试提交时遇到问题 - 正如您所确定的那样,某些文件无法在回购邮件中找到。

我发现的唯一解决方法(感谢您缩小可能原因的问题)是将端口添加到URL:https://svn.mysite.com:8443。这不应该是必要的,因为反向代理应该处理,因此我猜测它是VisualSVN的问题,可能会在将来的更新中修复。

答案 1 :(得分:0)

我有同样的问题。 失败的原因是IIS禁止使用.cs.config

这样的URL后缀

您可以通过将其添加到IIS代理的web.config中来解决此问题

<system.webServer>
  <security>
    <requestFiltering>
      <fileExtensions allowUnlisted="true" applyToWebDAV="true">
        <clear />
      </fileExtensions>
      <verbs allowUnlisted="true" applyToWebDAV="true" />
      <hiddenSegments applyToWebDAV="true">
        <clear />
      </hiddenSegments>
    </requestFiltering>
  </security>
</system.webServer>

此帖子的积分IIS7 and ARR as reverse proxy for Subversion

相关问题