开发者

Prevent obsolete properties being added to the designer files

开发者 https://www.devze.com 2022-12-15 00:18 出处:网络
In one of the user controls in our project we开发者_开发知识库 have an obsolete property looking like :

In one of the user controls in our project we开发者_开发知识库 have an obsolete property looking like :

    [Browsable ( false )]
    [Obsolete ( "Not currently supported on this control" )]
    public bool DeferPropertyValueUpdates

Every time I edit a form that contains this control, Visual Studio will put this property into the .designer file.

This then causes a warning to be generated, which makes my boss throw things at me.

How can I stop Visual Studio from putting this property in?


this is what you need

[Browsable(false), DesignerSerializationVisibility(
                            DesignerSerializationVisibility.Hidden)]


I believe a

    [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

attribute is what you're looking for.

0

精彩评论

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