Use Custom Class in another Custom Class

Discussion in '.NET' started by c4tech, Jul 1, 2009.

  1. c4tech

    c4tech

    Joined:
    Jul 1, 2009
    Messages:
    1
    I am using VB.net with ASP.net 2.0 and am not using Visual Studio. I use my text editor. I have written a class and wrapped it in a namespace called "MyBulb_NS". I want to import and use that namespace in another namespace that i've written called "MyLamp_NS". I have pasted a code snippet below to show how i import the namespace. MyBulb_NS has been compiled to a dll without errors. When I attempt to compile MyLamp_NS it fails. I have pasted its makefile and error below

    I am frustrated that it is so difficult to use a custom class in a different custom class. What needs to be done to get this to work? Please help! TIA!


    Code:
    'Code snipped from MyLamp.vb
    
    Option Explicit
    'Option Strict
    
    Imports System
    Imports System.Data
    Imports System.Data.OleDB
    Imports MyBulb_NS
    
    Namespace MyLamp_NS
    
    Public Class MyLamp
    ...
    	private bulb as new MyBulb
    ...
    End Class
    
    End Namespace
    
    makeMyLamp.bat
    ------------------------------------
    set indir=c:\www\components\MyLamp.vb
    set outdir=c:\www\bin\MyLampVB.dll
    set assemblies=System.dll,System.Data.dll,System.XML.dll

    C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe /t:library /out:%outdir% %indir% /r:%assemblies%
    pause



    Error from command line
    ------------------------------------------------
    c:\www\components\MyLamp.vb(7) : warning BC40056: Namespace or type specified in the Imports 'MyBulb_NS' doesn't contain any public
    member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

    Imports MyBulb_NS
    c4tech, Jul 1, 2009
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonah Olsson
    Replies:
    1
    Views:
    563
    Scott Allen
    Apr 5, 2005
  2. Toke H?iland-J?rgensen
    Replies:
    10
    Views:
    633
    Toke H?iland-J?rgensen
    Jan 1, 2004
  3. Piotre Ugrumov
    Replies:
    3
    Views:
    362
    Nick Hounsome
    Jan 25, 2004
  4. _Who
    Replies:
    7
    Views:
    2,632
  5. Matt Sokol
    Replies:
    2
    Views:
    366
    Theo Tillotson
    Aug 7, 2003
Loading...

Share This Page