'Reference error' on second attempt to inherit form from DLL

F

Frnak McKenney

Using C#.NET.2003 I'm running into a problem attempting to put
wrapper classes around managed Forms, and after six hours it's
getting hard to see whether it's a bug, bad documentation, or my
failure to understand the documentation. Any advice -- or comments
that can narrow my choices -- will be appreciated.

I'm writing a multi-form application whose form inheritance
structure I've already tried to lay out four or five times. Since
re-doing it is a real pain in the asterisk, I'd like to be able to
subclass the .NET managed Forms class several deep to cut down on
the time this takes to do.

Unfortunately, with my Latest'n'Greatest(tm) approach I keep running
into the following error message:

Reference error: Unable to reference 'MyDLL' to the current
application. Check that a different version of 'MyDLL' is not
already referenced.

Here's what I've tried to do:

In the MyDLL project I have:

class MyBaseForm : System.Windows.Forms.Form

class MyDbAccessForm: MyDLL.MyBaseForm

On this form I added a DataSet, an OleDbConnection, and
several DataAdapters.

Both of these are simple "wrapper" classes whose only purpose is to
leave a place for me to add changes later on as required.

I then tried creating a form frmMyMainForm in the MyApp project by
right-clicking on the project in Solutions Explorer and selecting
the Add->Inherited_Form option. When asked which reference I wanted
to add, I selected 'MyBaseForm' in 'MyDLL'.

So far, so good. The MyApp project now has a Reference entry
pointing it at MyDLL.

Then I attempt to add a second form -- frmMyDbBrowse -- to the MyApp
project using the same approach. Add->Inherited_Form, select the
'MyDbAccessForm' in 'MyDLL' as its ancestor, and... BOOM! A
'Reference error' message.

There seem to be very few reports of this particular error message,
and since I'm not attempting to inherit from an EXE file <grin>
those I've found don't appear to apply here.

Does anyone have any idea why this might be happening? I'm fairly
new to .NET, so there's lots of room for a Probable User error; if
so, can anyone suggest where I might be stumbling?


Frank McKenney, McKenney Associates
Richmond, Virginia / (804) 320-4887
Munged E-mail: frank uscore mckenney ayut minds pring dawt cahm (y'all)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top