Reputation: 8931
When opening a Form in the Visual Studio Designer, the generated designer files' contents get mixed up randomly. This includes the files
When using a version control system this is a real nightmare. Is there a way (extension?) that sorts and cleans up all designer files before saving? This would solve most of my VCS related issues with WinForms, as it reverses all the shuffling the designer does.
Upvotes: 1
Views: 883
Reputation: 9526
This is not a tip about automatically sorting Form.Designer.cs; however, it does help with avoiding merge help with all modifications made to Form.Designer.cs-files by Visual Studio.
Instead of (or in addition to) changing your work practices (by Jonathon Lee) and especially the constricting "Limit access to a form to 1 developer at a time" do:
Ensure the Form.Designer.cs-file is organized according to Visual Studio in a separate commit before you make the real changes.
TableLayoutPanel
to an other and back again did the trick.)Results:
Upvotes: 0
Reputation: 211
This problem sure does make merging difficult - I understand your pain.
Read this previous SO post: "Why does C# designer-generated code (like Form1.designer.cs) play havoc with Subversion?"
Basically you could create a tool to sort all the code alphabetically to give order to the random placement of code, but it is a hack and could involve a lot of pain itself. Personally I recommend changing your work practices to reduce this occurring.
Upvotes: 4