views:

233

answers:

1

Given the following inheritance tree:

I have a

public class BaseForm : Form

This is the base form for all WinForms in the project (or most) and contains some basic stuff.

Later in time, when Generics came, I created a

public abstract partial class GenericObjectListBase<T> : BaseForm

And finally, I specialized that one with a:

public partial class MySpecialList : GenericObjectListBase<MySpeciaType>

It all works, but designer doesn’t work in the last “MySpecialList”.

I’ve read this question and answer, but I’m not entirely sure how it applies to me, given that I’m trying to see a “non-generic” class (MySPecialList). In either case, the error I get is the same.

The designer could not be shown for this file because none of the classes within it can be designed… bla bla bla (check the other question to see the error).

Knowing that there’s some sort of “known limitation”, do you have a “known workaround”?

+2  A: 

This is a known problem. The VS designer will not let you have an abstract class in the middle of the inheritance tree.

Unfortunate, but that's the way it is. The best option is to make GenericObjectListBase a concrete class.

Mark Seemann
Thanks. Any ideas if VS2010 will “fix” this?
Martín Marconcini
No, I don't know that. Sorry.
Mark Seemann
Well, vs2010 will be out soon, I guess we’ll find out ;)
Martín Marconcini