开发者

Why is ASP.NET 2.0 removing the automatic XML summaries on Designer.cs when it regenerates?

开发者 https://www.devze.com 2022-12-14 15:08 出处:网络
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.c

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 go开发者_运维知识库ing down the Path Of Insanity? Removing a service pack is not an option in this situation.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消