Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
846 views
in Technique[技术] by (71.8m points)

visual studio - Why does C# designer-generated code (like Form1.designer.cs) play havoc with Subversion?

My workshop has recently switched to Subversion from SourceSafe, freeing us from automatic locks. This led to concurrent editing of the Forms, which is wonderful. But when multiple developers commit their changes, the code files created by the designer (all the files named TheFormName.designer.cs) cause conflicts which are very difficult to resolve.

As far as I can tell, this is because the code generated by the designer is heavily re-arranged whenever the user modifies it, no matter how little the actual change really did.

  • How do I make these conflicts easier to resolve?
  • Is there some way to tell the designer to modify the code less?
  • How do you, the experienced C# teams, deal with concurrent modification of a Form?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here are some things to try:

  • Make things more modular. Use components like User Controls etc. to split forms into multiple, smaller physical files.
  • Use presentation layer design patterns like MVP to move code out of views and into standard POCO classes.
  • Recent versions of SVN allow you to take hard locks - use this to avoid complex merge scenarios.

Hope that helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...