Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. NEED HELP: Reference error when using subclasses

NEED HELP: Reference error when using subclasses

Scheduled Pinned Locked Moved Visual Basic
helpquestiontoolsannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vera
    wrote on last edited by
    #1

    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.CBase1 ASSEMBLY AWebClasses 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: _ 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 ... oObj1.Init(oTool) oObj2.Init(oTool) ... 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.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. 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.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. 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!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups