Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you manage .vcproj files in source control which are changed by multiple developers?

We use Subversion as our source control system and store the VisualStudio project files (vcproj) in the source control system as is normal I think. With Subversion we don't use any form of file locking, so if two developers are working on the same project at the same time and both add files to the project, or change settings, the second one to commit has to merge the changes.

How do you merge these changes?

The vcproj files are just text files so it is possible to edit them by hand but they are not very amenable to hand editing, especially by junior developers.

The ways I can think of are

  • Get the latest version from svn and re-add all local changes manually
  • Edit the file by hand to resolve any conflicts from an automatic merge
  • Implement some form of locking scheme to prevent simultaneous changes
  • Have an agreement between developers so they do not make simultaneous changes

Currently we are using the first option of re-adding all changes manually but this is time consuming and I was wondering if there is a better way.

With source files the automatic merge feature works most of the time and we don't get many conflicts.

like image 663
David Dibben Avatar asked Oct 03 '08 13:10

David Dibben


People also ask

How do I view the contents of a vcxproj file?

You can inspect the contents of a .vcxproj file by using any text or XML editor. You can view it in Visual Studio by right-clicking on the project in Solution Explorer, choosing Unload project and then choosing Edit Foo.vcxproj.

What are the default VC++ project settings?

This property sheet contains the default settings for a VC++ project. It contains definitions of all the project settings such as Platform, PlatformToolset, OutputPath, TargetName, UseOfAtl, etc. and also all the item definition group defaults for each known item group. In general, properties in this file are not tool-specific. –>

What is the default project system in Visual Studio?

MSBuild is the default project system in Visual Studio; when you choose File > New Project in Visual C++ you are creating an MSBuild project whose settings are stored in an XML project file that has the extension .vcxproj. The project file may also import .props files and .targets files where settings can be stored.

What is source control and version control?

Source control refers to tracking and managing changes to code. This ensures that developers are always working on the right version of source code. Source Control vs. Version Control These two terms are used interchangeably.


2 Answers

I've found that option 2 (edit the files by hand) generally works fairly well, as long as you're using a good diff tool (I use WinMerge). The main problem I've run into is that Visual Studio will sometimes reorder the file. But, if you have a good diff/merge tool then it should be able to differentiate between changed content and moved content. That can help a lot.

like image 59
Herms Avatar answered Sep 21 '22 10:09

Herms


You might find Project: Merge or Tools for SLN file useful

like image 37
sivabudh Avatar answered Sep 19 '22 10:09

sivabudh