VS IDE问题导致项目文件中的代码冲突 [英] VS IDE Issue Causing Code Conflicts in Project Files

查看:126
本文介绍了VS IDE问题导致项目文件中的代码冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部,

这可能不是提出这个问题的地方,但必须表达出来。  

This may not be the place to raise this issue, but it has to be expressed.  

在项目文件中添加和删除内容时,我遇到了与其他团队成员无数的代码冲突(尽管是CSProj,VBProj等)。 问题似乎是由VS IDE引起的,它不对项目文件元素进行排序。 对于
示例,如果我的项目有一个名为"Class1.cs"的文件,那么我检查这个项目,当另一个团队成员向项目添加新文件时,通常会发生冲突。 由于VS没有任何标准来安排项目
文件中的这些项目,因此它们最终可能会出现在随机行中。 如果有人意外删除或排除了"Class1.cs",则会加剧此问题。 。文件 当他们将文件添加回项目时,VS通常会在项目文件中将引用放在完全不同的行(并且
甚至是不同的组)。 

I've experience countless code conflicts with other team members when adding and removing content from a project file (albeit CSProj, VBProj, ect.).  The issue seems to be caused by the VS IDE which does not sort the project file elements.  For example, if my project has a file called "Class1.cs" and I check this project in, when another team member adds a new files to the project, there is often a conflict.  Since VS does not have any standard for arranging these items in the project file, they can end up on random lines.  This issue is exacerbated if someone accidentally deleted or exclude the "Class1.cs" file.  When they add the file back to the project, VS often puts the reference on a totally different line (and even a different group), in the project file. 

如果VS会按名称对文件中的项目进行排序,那将是有意义的。 如果VS有一些可辨别的方法来对文件中的项目进行分组,这也会有所帮助。 这样,删除和添加文件将始终以一致的行结束。 
此外,添加新文件(基于其名称)将最终出现在项目文件中可辨别的位置;这将减少冲突。

It would make sense if VS would sort the items in the files by name.  It would also help if VS had some discernable method of grouping items in the file as well.  This way the removal and addition of a file will always end up on a consistent line.  In addition, adding of new files (based on their name), would end up on a discernable location in the project file; which will reduce conflicts.

我已经在TFS,VSTS和Git代码库中发现了这个问题,并且可以绝对肯定地说这个问题仅由VS IDE引起。  

I've observed this issue with TFS, VSTS and Git code repositories and can say with absolute certainty that the problem is cause by the VS IDE only.  

- Rashad Rivera [omegusprime.com]

- Rashad Rivera [omegusprime.com]

推荐答案

<你好Rashad Rivera,

Hi Rashad Rivera,

很抱歉延迟回复。

你的视觉工作室版本是什么?

What is your version of your visual studio?

我们使用visual studio 2017 15.9.10将文件重新添加到项目中,文件可以按名称排序。然后保存项目并打开.csproj文件,元素也按其原始位置排序

We use visual studio 2017 15.9.10 to re-add file into project and the file can be sorted by their name. Then save the project and open .csproj file, the elements have been also sorted in their original position.

请试试2017年的Visual Studio。如果此问题仍然存在,请与我们分享截图进行进一步的排查。

Please have a try with visual studio 2017. If this issue persists, please share screen shots with us for further troubleshooting.

最诚挚的问候,

Dylan

 


这篇关于VS IDE问题导致项目文件中的代码冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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