Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Custom constructors with types from separate project breaks winforms designer (VS2010)
 

Custom constructors with types from separate project breaks winforms designer (VS2010)


I've found an issue with the winforms designer in VS2010, exactly the same scenario works without any problems in VS2008. I've attached a repro solution for both VS2008 (WinApp08) and VS2010 (WinApp).

To repro the issues (in WinApp):

1) Try opening InherritedForm in the designer. You should get an error saying that ClassLib cannot be loaded.

There are two factors that needs to be in place for this to trigger. A component with an constructor that has a parameter using a type from another project needs to be instanciated in the constructor of a forms base form. The constructor on the baseform needs to call the constructor with this parameter (calling a different overload that does not have such a parameter does not trigger the issue). I have not tested if this only applies to components or if it also applies to controls aswell. It happens regardless of how many overloads there exists for the constructor on the component. Also if there is only one constructor, and this constructor contains such a parameter.

2) Open RegularForm. Try to drag MyExtender onto the form. You should get an error saying that ClassLib cannot be loaded.

For this to trigger it is enough that you have a constructor on the component that contains a parameter using a type from another project. I have not tested if the same applies to controls aswell.


Please note that the attached projects are repro projects. In the real project where I experience this, my extender only has a single constructor that has one such parameter.

The repro projects can be found here:
http://cid-4a7c8cdf61fa0160.skydrive.live.com/self.aspx/.Public/WinApp.zip
http://cid-4a7c8cdf61fa0160.skydrive.live.com/self.aspx/.Public/WinApp08.zip


Am I doing something I shouldn't do, or is this a bug introduced in VS2010?

Issue is also registered at connect:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=476351
nillebo  Wednesday, July 22, 2009 6:06 PM
Hi nillebo,

The same problem can be reproduced on my side. Since Visual Studio 2010 is still in the beta stage, the feedback for the product is very important. As I can see you've already submitted the problem in the connect, the engineers there will confirm you if it's product issue, and will seriously consider this before the product is going to be ultimately released.

In addition, there're specialized forums for "Visual Studio 2010 Beta ", you can post the problem there for a discussion.


Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Thursday, July 23, 2009 6:48 AM
Hi nillebo,

The same problem can be reproduced on my side. Since Visual Studio 2010 is still in the beta stage, the feedback for the product is very important. As I can see you've already submitted the problem in the connect, the engineers there will confirm you if it's product issue, and will seriously consider this before the product is going to be ultimately released.

In addition, there're specialized forums for "Visual Studio 2010 Beta ", you can post the problem there for a discussion.


Best regards,
Bruce Zhou
Please mark the replies as answers if they help and unmark if they don't.
Bruce.Zhou  Thursday, July 23, 2009 6:48 AM

You can use google to search for other answers

Custom Search

More Threads

• Create Toolbar
• A Split Textbox
• VS form designer eats up lots of disk space...
• Previously visible user control becomes invisible in design view of winform(vb.net) in VS 2008.
• File copying
• Using DirectX to render non-game Windows.Forms controls
• My Question about toolbar in VS2005
• ActiveX Control in Windows Service designer
• programmically / dynamically addressing controls in a winform
• Setting background a foreground colors in a textbox