CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 1/11/2007 9:28:14 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 11 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
jrummell
Asp.Net User
The designer must create an instance of type '<type name>' but it cannot because the type is declared as abstract.1/11/2007 9:28:14 PM

0/0

I am getting this error when I try to view a component I've created in the designer.  It inherits an abstract component class, but I'm not going to make it non-abstract to please the designer ...  I ran across this thread in the VS 2002/2003 forum saying it was a limitation of the designer --> http://forums.asp.net/thread/310810.aspx. Is there no way around this in VS 2005?


 


John Rummell
DMW
Asp.Net User
Re: The designer must create an instance of type '<type name>' but it cannot because the type is declared as abstract.1/12/2007 2:00:22 AM

0/0

There is a simple workaround: make the base type concrete.

Then add documentation that states that you'll break the fingers of any developer that instantiates an instance of the base type ;-)

Sorry.

I find it deeply frustrating that the designers need to instantiate objects, but they still appear to in VS 2005.

 


Dave
jrummell
Asp.Net User
Re: The designer must create an instance of type '<type name>' but it cannot because the type is declared as abstract.1/12/2007 3:10:44 AM

0/0

well there are 2 abstract classes in the derived component's inheritance tree, so I won't be making both of them concrete.  I guess I'll just do without the designer.  It's nice to have, but not necessary.

John Rummell
TATWORTH
Asp.Net User
Re: The designer must create an instance of type '<type name>' but it cannot because the type is declared as abstract.9/12/2007 4:01:07 PM

0/0

How can you make the base type concrete when it is DataGridColumnStyle? 

 (DataGridColumnStyle is part of System.Windows.Forms and please don.t flame me for asking a Winforms question on this forum as I cannot currently log onto forums.microsoft.com)

 I am using VS2005 Team version with SP1 on a Windows XP Sp2 platform.

I have tried the following without success:

  • Compile in release and then in debug.
  • Delete the reference to System.Windows.Forms and re-add it.
  • Close the designer window, recompile, view the code. right click and select the designer from the code window.

The error message I get is:

The designer must create an instance of type 'System.Windows.Forms.DataGridColumnStyle' but it cannot because the type is declared as abstract.


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
4 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

12 - An Eclipse GUI Builder Select the type of Designer that you want to activate, select the desired mode, and then ... generates code using the block style: a control is declared and ...
Eric Gunnerson's C# Compendium : Be a language designer... ... and it would be better if I explicitly declared it as being so (using the type? ... But the real value is that it says "This cannot be null", period. ...
jasonbock.net The designer must create an instance of type 'Viktor.ClassFirstTests.AbstractControl' but it cannot because the type is declared as abstract. ...
abstract UserControl - MSDN Forums The designer must create an instance of type 'CGS.WinUI.BaseUserControl' but it cannot because the type is declared as abstract. ...
The Inform Designer's Manual For instance, if oil_left has been declared as a variable (see below), then the statement ... The default clause is optional but must be placed last if at all: ...



 
All Times Are GMT