无法将多个文件从Visual Studio项目提交到Subversion [英] Can't commit several files from Visual Studio project to subversion

查看:93
本文介绍了无法将多个文件从Visual Studio项目提交到Subversion的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Since a few weeks, I have some problems with Subversion. When I try to commit files from a Visual Studio 2017 project there are some files which I can't commit to my Visual SVN Server. To be precise all files in the project folder like *.cs, *.config, *.csproj, *.resx, ...

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

My setup:
Client: TortoiseSVN 1.9.7 on Windows10
Server: VisualSVN behind a IIS-ReverseProxy running on Windows Server 2012r2

例如,我尝试提交* .cs文件时遇到的错误:

The error I get when I try to commit for example a *.cs file:

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.

更新工作副本已成功完成,但不能解决问题.

Updating the working copy is finishing successfully but doesn't fix the problem.

您可以在下面的图片中看到我的项目.为了进行测试,我创建了一个全新的空存储库.如您所见,.vs,bin和obj文件夹及其中的所有文件均被忽略,所有其他文件夹均提交给服务器(其中没有文件).在第二张图片中,您可以看到我可以提交* .sln文件,但是在项目文件夹中没有其他文件.

You can see my project in the picture below. For testing, I created a completely new and empty repository. As you can see the .vs, bin and obj folders are ignored with all the files inside of them, all other folders are committed to the server (without the files inside of them). In the second picture you can see that I can commit the *.sln file but no other file in the project folder.

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

For testing, I created an empty text file and renamed it to text.cs. Even this empty file cannot be committed to the Server with the same error message.

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

Due to the fact that this is happening to all Clients, it is more likely to be a problem on the Server side I guess but I have no idea what could cause this error. Unfortunately, the VisualSVN Server has no error logging or at least not the free version I'm using.

对于解决这个烦人的问题,我将不胜感激.

I would be very grateful for any tip I can get to solve this annoying problem.

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

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

After connecting via port 8443 directly to the VisualSVN server (bypassing the reverse proxy) everything is working again. So there must be a problem with the configuration of the URL Rewrite module. To be honest it took me quiet a long time to get it working somehow because my knowledge about all the settings is very limited.

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

This my Web.config with the settings for the URL Rewrite module. Maybe there is something not configured as it should be. If you need further information just ask.

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

I had the same issue. The fails because IIS prohibits URL suffixes like .cs and .config

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

You can work around this by adding this to the web.config of the IIS proxy

<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和ARR作为Subversion的反向代理

这篇关于无法将多个文件从Visual Studio项目提交到Subversion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆