NEED HELP: References error when using subclasses

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vera

    #1

    NEED HELP: References error when using subclasses

    Hi,

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

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

    ASSEMBLY ATools

    References: None
    Namespace : Tools
    Classes : CToolClass

    ASSEMBLY ABaseClasses

    References: ATools
    Namespace : BaseClasses
    Classes : CBase1, CBase2

    ASSEMBLY ASubClasses

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

    ASSEMBLY AWebClasses

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

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

    The webclass has a method, which SHOULD look something like this:
    <WebMethod> _
    Public Function MyWebMethod() As String
    Dim oObj1 As SubClasses.CSub 1 = New SubClasses.CSub 1
    Dim oObj2 As BaseClasses.CBa se2 = New BaseClasses.CBa se2
    Dim oTool As Tools.CToolClas s = New Tools.CToolClas s
    ...
    oObj1.Init(oToo l)
    oObj2.Init(oToo l)
    ...
    Return ...
    End Function

    PROBLEMS
    The following problems occur in MyWebMethod:
    1.
    In the above situation, I get an error on the line "Dim oObj1 As SubClasses...": "Reference required to assembly 'ABaseClasses' containing the type 'ABaseClasses.C Base1'. 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.CBas e1.

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

    QUESTION
    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!


Working...