views:

496

answers:

1

I have several forms in a C# application. I use Visual Studio 2010 Beta, but .NET 3.5 and C# 3 (so not the new stuff).

I have a base form, called FilteredQueryViewForm in the Shd namespace and I want some other forms to inherit it (because they will basically do the same stuff, but with some additions).

I changed things from private to protected in the FilteredQueryViewForm class, so they're accessible from the derived forms. After this I've created a derived form and set the base class to FilteredQueryViewForm.

The designer of the derived class complained about Shd.FilteredQueryViewForm not having any constructors... regardless of the fact it had one, with 3 parameters. I thought parameters can be a problem, so I also created a (public, of course) constructor without parameters, but it still doesn't work. The error message is the same:

"Constructor on type 'Shd.FilteredQueryViewForm' not found."

And the designer of the derived class won't load. I have tried restarting vs2010beta, re-creating the derived form, but nothing seem to help. Google didn't yield any useful results for me on this problem. :(

Is this a problem of Visual Studio 2010 Beta? Or am I doing something wrong?

+1  A: 

Hi there

You will need a constructor without parameters which calls the InitializeComponent() method in every of your forms. Then close the designer window, rebuild the solution and try to reopen the designer. That should work. Rebuilding the solution is essential.

The problem is, that if you create a form that inheritates from Shd.FilteredQueryViewForm, the designer will try to call the constructor of the parent form, but it loads this form not from code but from it's built assembly.

with best regards

Emiswelt
Thank you, rebuilding the solution was the step I missed.
ShdNx