c# - Can visual studio designer show classes inheriting generic types? -


i trying clean designer errors in our solutions , ran following error:

the designer not shown file because none of classes within can designed. designer inspected following classes in file: doubleattributetextboxbase --- base class 'numericattributetextboxbase' not loaded. ensure assembly has been referenced , projects have been built.

the classes both defined in same assembly know it's not reference problem. i'm wondering if has fact base class generic. ideas?

public class doubleattributetextboxbase : numericattributetextboxbase<double>  public class numericattributetextboxbase<t> : textbox t : icomparable, icomparable<t> 

the base class class being designed must non-abstract , non-generic. make class inherits generic class designable. workaround insert trivial non-generic class in-between:

public partial class doubleattributetextboxbase     : numericattributetextboxbaseofdouble {     public doubleattributetextboxbase()     {         initializecomponent();     }      // doubleattributetextboxbase designable. }  public class numericattributetextboxbaseofdouble     : numericattributetextboxbase<double> { } 

to make simple possible, can put non-generic class in same file class want design. make sure put after class (as have done above) because designer expects first class in file 1 being designed.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -