visual-studio - 无法将多个文件从 Visual Studio 项目提交到颠覆

标签 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 服务器没有错误记录,或者至少不是我使用的免费版本。

如果我能得到解决这个恼人问题的任何提示,我将不胜感激。

Edit1:问题是由 IIS 反向代理引起的

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

这是我的 Web.config,其中包含 URL 重写模块的设置。也许有些东西没有按应有的方式配置。如果您需要更多信息,请询问。

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

最佳答案

我遇到了同样的问题。 失败是因为 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

关于visual-studio - 无法将多个文件从 Visual Studio 项目提交到颠覆,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46254149/

相关文章:

visual-studio - 在VS2015中调试Powershell无法可视化XML对象

python - 服务器日志和我的客户端之间的 SOAP 调用执行时间测量差异

c# - 如何配置部署在 IIS 和远程客户端上的 WCF 服务以从远程客户端 PC 进行身份验证?

linux - Eclipse Kepler 在 Ubuntu 13.10 上经常崩溃

SVN合并本地主干到分支

svn - 如何在 Subversion 中部分撤消提交?

visual-studio - VS2008:禁用询问是否重新加载IDE外部更改的文件

windows - Visual Studio 在 Windows 7 上将 WINVER/_WIN32_WINNT 设置为 Windows 8?

windows - 如何在Windows上使用clang从命令行传递链接描述文件?

c# - ASP.Net 网站项目的程序集名称