Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Cannot inherit form from base class form in DLL
 

Cannot inherit form from base class form in DLL

I have a project containing a dll specifically for base class forms. The project has another dll for customized versions of these base class forms. I successfully created two base class forms and inherited them. Then I created a third base class form, but when I attempt to create a new form that inherits from this base class form, I get the following designer error shown below. The base class form is trivial (a form with 3 labels and4 standard controls).

If I create the inheriting form in the same project (dll) as the base class form, it works as expected. In all other respects, the code works as expected. I have read through many postings that seem related to this problem but none of the proposed solutions help (deleting obj folder, exiting and entering studio, removing static member functions, adding DesignMode test, etc) I will be happy to share the project and code demonstrating this problem to anyone who is willing to take a look.

One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes.

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: DataDialogPhasor --- The base class 'System.Object' cannot be designed.

Hide

at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)

KMyers1  Monday, March 24, 2008 5:41 PM

I found the solution to this problem. The project containing my inheriting class had a reference to the dll containing the base class. When I removed this reference, the problem went away.

KMyers1  Tuesday, March 25, 2008 12:13 AM

I found the solution to this problem. The project containing my inheriting class had a reference to the dll containing the base class. When I removed this reference, the problem went away.

KMyers1  Tuesday, March 25, 2008 12:13 AM
Hi KMeyers1

I don't understand your resolution. You have a view (the inheriting view) which resides in Project A. Your base view (lets say ViewBase) resides in Project B. Your problem was that Project A references project B. Removing that reference should result in compilation errors as Project A no longer knows what ViewBase is.

What am I missing?

Regards,
Jacques
addey  Tuesday, September 15, 2009 7:44 PM

You can use google to search for other answers

Custom Search

More Threads

• Wepos 1.1 Image and registry key
• Design time compilation symbol
• how to add context menu in test results window through visual studio integration package sdk
• ContainerFilterService implementation
• form position on runtime
• Imports Data from XLS file to DataGridView VB 2005
• Intellisense won't work on many collections
• Localizing multiple forms using a single resource file
• Custom control not working (MSDN walkthrough)
• Picturebox question