By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,997 Members | 2,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,997 IT Pros & Developers. It's quick & easy.

NEED HELP: References error when using subclasses

P: n/a

I have a very annoying problem, with which I NEED HELP DESPERATELY!!
It smells like a bug to me, but I'm not sure.

This description is a very much simplified version of the real situation.
I have the following class structure:


References: None
Namespace : Tools
Classes : CToolClass


References: ATools
Namespace : BaseClasses
Classes : CBase1, CBase2


References: ABaseClasses, ATools
Namespace : SubClasses
Classes : CSub1 Inherits BaseClasses.CBase1


References: ABaseClasses, ASubClasses, ATools
NameSpace : WebClasses
Classes : CWebClass Inherits System.Web.Services.WebService

Both baseclasses have a method with signature:
Public Sub Init(ByVal parm As Tools.CToolClass)

The webclass has a method, which SHOULD look something like this:
<WebMethod> _
Public Function MyWebMethod() As String
Dim oObj1 As SubClasses.CSub1 = New SubClasses.CSub1
Dim oObj2 As BaseClasses.CBase2 = New BaseClasses.CBase2
Dim oTool As Tools.CToolClass = New Tools.CToolClass
Return ...
End Function

The following problems occur in MyWebMethod:
In the above situation, I get an error on the line "Dim oObj1 As SubClasses...": "Reference required to assembly 'ABaseClasses' containing the type 'ABaseClasses.CBase1'. Add one to your project.".
As you can see, the reference is already there.
To solve this problem for the time being, I copied CBase1 into ASubClasses and made CSub1 inherit SubClasses.CBase1.

After the changes made as described in 1., another error of the same type appears: "Reference required to assembly 'ATools' containing the type 'ATools.CToolClass'. Add one to your project.". However, this error appears only on the line "oObj1.Init(oTool)", which references a subclass. It does not appear on the line "oObj2.Init(oTool)", which references a baseclass.
And again, the reference is already there.

1. What causes the problem?
2. What can I do to solve it?

Obviously, copying all my classes into one single assembly is not what I want. So, what should I do?

PLEASE HELP ME! Thanx a lot!
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.