views:

60

answers:

2

I'm working on a large project with several other programmers, using Subversion source control. The problem comes when I change files, regenerating the designer.cs file, and go to commit my designer.cs files--they strip out all XML comments, giving a source history like this:

Before:

    /// <summary>
    /// MenuUpdatePanel control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.UpdatePanel MenuUpdatePanel;

    /// <summary>
    /// _changePersonLink control.
    /// </summary>
    /// <remarks>
    /// Auto-generated field.
    /// To modify move field declaration from designer file to code-behind file.
    /// </remarks>
    protected global::System.Web.UI.HtmlControls.HtmlAnchor _changePersonLink;

After:

    protected System.Web.UI.UpdatePanel MenuUpdatePanel;
    protected System.Web.UI.HtmlControls.HtmlAnchor _changePersonLink;

Of course, this means that mine effectively marks the entire file as changed, if I add even a single control to a page. Trying to resolve conflicts is a pain, for me, or for others.

The question remains...what odd setting got turned on, that mine would change designer files this way? How can I save my teammates from going down the Path Of Insanity? Removing a service pack is not an option in this situation.

+1  A: 

Your comments aren't really being stripped. What's happening is that the designer.cs files are being completely regenerated. Visual Studio makes no guarantees that any changes you make to those files will be preserved, because they are auto-generated.

If you want to keep a change history for those files, keep it in a separate file.

RickNZ
A: 

It might be related to VS 2005 SP1. See: Eliminating Auto-generated Comments in the designer.cs File and Is there a way to turn on Auto-generated field designer.cs comments?

Check if you have SP1 installed and, if so, try reinstalling it. Also, as suggested in the second link, you can try to copy the settings of a well-behaving copy of Visual Studio via Import and Output Settings.

Tadmas