How to disable designer in derived classes in following generations

前端 未结 2 2165
时光说笑
时光说笑 2021-02-15 16:06

In order to disable component designer in classes it is simple to add just [System.ComponentModel.DesignerCategory(\"\")] attribute to it, however it does not work for any class

相关标签:
2条回答
  • 2021-02-15 16:54

    "Attribute inheritance" at first struck me as odd, as I always thought that attributes weren't inherited; after checking docs.microsoft.com I discovered that that doesn't have to be the case - attributes may have Inherited = true, so thanks to you for helping me broaden my knowledge :-)

    Additionally, I also had to remove a bunch of <SubType>Component</SubType> entries from the .csproj file

    0 讨论(0)
  • 2021-02-15 16:56

    The reason for such behaviour is cached referenced assemblies. To solve it, remove reference to the assembly contained base server with attribute and add it again. In this case Visual Studio rebuild project and will not define default editor to derrived class.

    0 讨论(0)
提交回复
热议问题