0

I have following class structure:

public partial class SickForm<T> : MyForm where T : class {}

public class MyForm : Form, ExternalAssemblyNamespace.ISomething {}

After opening MyForm in designer, everything loads properly. But after opening SickForm in designer, I'm facing this error:

The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file:

SickForm --- The base class 'MyForm' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.

How to fix this ? This problem occurs while I'm using VS2010 express. In VS2008 express it works ok.

jwaliszko
  • 16,942
  • 22
  • 92
  • 158
  • Have you tried cleaning and rebuilding the solution? – Jobo Jan 05 '13 at 17:47
  • Well, what's special about MyForm? Is it located in another assembly? Does it have a default constructor? – Hans Passant Jan 05 '13 at 17:54
  • Fresh rebuild doesn't help. It's the same assembly. There are 2 constructors in MyForm - the one of them is default and protected. – jwaliszko Jan 05 '13 at 17:58
  • The `ISomething` interface is defined in separate assembly, if it is any clue. Without this inheritance works ok, but I need it anyway. – jwaliszko Jan 05 '13 at 18:25
  • You also can check this: http://stackoverflow.com/a/16089790/908336 It worked for me and is a very simple workaround compared to copying to `IDE\PublicAssemblies`. – Masood Khaari Nov 27 '13 at 06:50

1 Answers1

0

I've found workaround (can someone explain me, why I had to do it and how to resolve this issue in any better way ?)

For some reason, after I copied my external assembly which contains infamous ISomething declaration to ...\IDE\PublicAssemblies directory, VS2010 started properly rendering form designer after restart.

jwaliszko
  • 16,942
  • 22
  • 92
  • 158