Prevent obsolete properties being added to the designer files
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.
精彩评论