Making the Visual Studio designer ignore a public property

前端 未结 4 2222
小蘑菇
小蘑菇 2021-02-13 19:48

I have a UserControl with a public property using the following attributes:

[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.H         


        
4条回答
  •  深忆病人
    2021-02-13 20:42

    I failed to find a real solution, but a workaround instead...

    I had to go into the Form.resx file and locate the data/value key pair that it was deserializing into my public property. I manually deleted the XML pair contents and then I was able to run the application.

    This allowed my application to build and run without errors. Everything else I tried (including deleting the container form for my UserControl and re-creating it repeatedly) did not work.

提交回复
热议问题