We just recently switched from TFS to Mercurial for our small team. The main project that 3 people work on is a Windows Forms application in C#. Every time you use the designer, even for simple changes, it does a whole lot of rearranging and changing to the .Designer file. If two people work on this file, even making simple changes, the merge is an absolute nightmare. Is there an easy way to solve this problem? In TFS, we turned off concurrent edits so we did not have this problem.
The problem is every time the code gen engine may generate code in different order!!! which makes merging a pain.
WinForm (.NET) designer, Swing (Java) designer rely on the code gen engine.
ASP.NET's designer.cs only contains backing field, which less likely to suffer.
WPF's backing field is generated in obj/*.g.cs, which is not required to keep in source control, so no merging problem.
Merges of these kind of files are always painfull... This is the reason why some "locking" extensions for Mercurial exists, so you can have the same workflow as with TFS if needed.
For example you can use the Lock extension written by Martin Geisler to lock .Designer files until the next push
, doing so you will avoid any concurrent modification thus avoiding the merge also.
This is what I do:
- Copy/Use .Desinger.cs from master/develop branch and open project in VS
- Copy whole project (all files with .git) and checkout your_feature branch and open project in VS
- now at this point you should have 2 instances of VS (one on master branch and one on your_feature)
- Copy controls (ctrl+c) (in design view/mode) from one VS to another
not perferct solution but helps a lot
© 2022 - 2024 — McMap. All rights reserved.
*.Designer.cs
is a pain -- period. – Traceytrachea