TFS:在两个分支之间合并有两个项目之间的项目引用的.csproj文件 [英] TFS: Merging .csproj files between two branches that have project references between two branches

查看:105
本文介绍了TFS:在两个分支之间合并有两个项目之间的项目引用的.csproj文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当这些分支中的.csproj项目文件在其各自的分支中均具有其他项目引用时,将dev分支合并到主分支中时遇到问题。例如,想象下面的TFS源代码控制结构:

I'm having a problem with merging dev branch into main branch when .csproj project files in those branches each have other project references in their said branch. For example, imagine the TFS source control structure below:


  • Web项目1(TFS团队项目)


    • Dev分支


      • MyWebsite.csproj


      • MyWebsite.csproj


        • Web Project 2( TFS团队项目)


        • MyWebsite2.csproj


        • MyWebsite2.csproj


        • Dev分支


          • MyDatabase.csproj


          • MyDatabase.csproj


            • 其他公共图书馆(TFS团队项目)


            • MyClassLibrary.csproj


            • MyClassLibrary.csproj

            实际上,结构比上面的要复杂一些,因为有更多的项目具有相同的分支结构,但是要解决的问题是相同的。

            In reality, the structure is a bit more complex than the above as there are more projects that have the same branch structure, but the problem to be solved is the same.

            网站项目开发分支引用数据库和公共项目开发分支,网站项目主要分支引用数据库和公共项目主要分支。例如,MyWebsite.csproj文件中的引用可能是:

            The Website Project Dev Branches reference the Database and Common project Dev Branches, and the Website Project Main Branches referenc the Database and Common Project Main Branches. For example, the reference in the MyWebsite.csproj file might be:

                <ProjectReference Include="..\..\Database Project\Dev Branch\MyDatabase.csproj">
              <Project>{312ced42-f890-4d64-b27d-9ae53a42304c}</Project>
              <Name>MyDatabase</Name>
            </ProjectReference>
            

            因此,您正在dev分支中进行更改,而dev分支中的.csproj文件是否正确引用了dev分支中的其他.csproj文件;但是当您将dev分支合并到main分支时,.csproj文件正在尝试将引用从trunk分支更新为dev分支。

            So, you're making changes in the dev branches, and the .csproj files in the dev branch are properly referencing the other .csproj files in the dev branch; but when you go to merge the dev branch into the main branch, the .csproj files are trying to update the references from the trunk branch to the dev branch.

            什么是解决此问题的最佳实践,这样当您从开发人员合并到主干时,主干项目仍然可以正确引用其他主干项目,并且不会更新到开发分支引用吗?

            What is the best practice to resolve this issue so that when you merge from dev to trunk, the trunk projects still properly reference the other trunk projects and don't get updated to dev branch references?

            编辑寻找一个无误的建议,并且不能将它们合并到一个分支下,因为实际结构比上面概述的要复杂得多。在3个单独的TFS团队项目中,有3个单独的Web应用程序引用了这些公共库中的几个,它们也都在自己的TFS项目中。然后,每个团队项目都有dev和main分支。

            edit looking for a non-nuget suggestion and am not able to combine them under one branch because the actual structure is far more complicated than outlined above. There are 3 separate web applications in 3 separate TFS team projects that reference several of these common libraries, which are also each in their own TFS projects. And then each of these team projects have dev and main branches.

            推荐答案

            如果这些内容是单独版本的,请停止依赖项目引用。将它们转换为NuGet程序包,将其发布到NuGet提要,然后依靠NuGet引用来还原正确的版本。

            If these things are versioned separately, stop relying on project references. Turn them into NuGet packages, publish them to a NuGet feed, and rely on NuGet references to restore the correct version.

            如果未分别对这些内容进行版本控制,请将所有它们在同一分支下,并且依赖于不包含分支文件夹名称的项目引用的相对路径。

            If these things are not versioned separately, put all of them under the same branch and rely on relative paths for your project references that do not include the branch folder name.

            这篇关于TFS:在两个分支之间合并有两个项目之间的项目引用的.csproj文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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