Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to resolve VS2010 Windows Form Designer issue (base class could not be loaded)
    text
    copied!<p>I have recently been getting an error in the Windows Forms designer of VS2010SP1 when using inherited UserControls.</p> <p>The error is </p> <blockquote> <p>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: DebugPanel --- The base class 'UI.Panels.PanelBase' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.</p> </blockquote> <p>PanelBase is a UserControl that is defined in the same class library as DebugPanel that also implements an interface IPanel (which is in turn defined in the same class library). IPanel implements an interface IBaseItem that is defined in a different class library.</p> <p>So we have</p> <pre><code>DebugPanel (Library UI.Shared2) - PanelBase (Library UI.Shared2) - UserControl (System.Windows.Forms - .NET4) - IPanel (Library UI.Shared2) - IBaseItem (Library Net.Common) </code></pre> <p>PanelBase is designable correctly, the project all builds correctly and works but when I try and design any inherited control the designer fails. This is not limited to the DebugPanel control, but any control inheriting from PanelBase... I've also seen the issue with other controls that I use that have similar inheritance hierarchies.</p> <p>I can generally resolve the problem temporarily by cleaning the library UI.Shared2, closing VS and then opening it again, rebuilding the solution and opening the designer. This will then work for a short while and then start to fail again.</p> <p>Does anyone have any suggestions that can resolve this issue permanently without resorting to restarting VS?</p> <p><strong>Edit:</strong> I am targeting the full version of .NET 4 with all libraries.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload