How do you get a dll to see another dll in compilation?

Discussion in 'ASP .Net' started by JimO, May 24, 2006.

  1. JimO

    JimO Guest

    I have a namespace called utility that I compiled using the /t:library
    switch. It compiles fine. When I try to import it into a database
    interface namespace, I get an error on compilation that says it's undefined
    and then one that says the class has no public members or cannot be found.

    Thanks,
    Jim
    JimO, May 24, 2006
    #1
    1. Advertising

  2. Is the utility dll located in the /bin directory of your application ?




    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "JimO" <> wrote in message
    news:_7Ncg.6938$...
    >I have a namespace called utility that I compiled using the /t:library
    > switch. It compiles fine. When I try to import it into a database
    > interface namespace, I get an error on compilation that says it's undefined
    > and then one that says the class has no public members or cannot be found.
    >
    > Thanks,
    > Jim
    >
    >
    Juan T. Llibre, May 24, 2006
    #2
    1. Advertising

  3. JimO

    JimO Guest

    Yes. I even placed the source code of the database module there just to see
    if that would work.

    "Juan T. Llibre" <> wrote in message
    news:...
    > Is the utility dll located in the /bin directory of your application ?
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > aspnetfaq.com : http://www.aspnetfaq.com/
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ===================================
    > "JimO" <> wrote in message
    > news:_7Ncg.6938$...
    > >I have a namespace called utility that I compiled using the /t:library
    > > switch. It compiles fine. When I try to import it into a database
    > > interface namespace, I get an error on compilation that says it's

    undefined
    > > and then one that says the class has no public members or cannot be

    found.
    > >
    > > Thanks,
    > > Jim
    > >
    > >

    >
    >
    JimO, May 24, 2006
    #3
  4. Source code placed in the /bin directory won't get compiled.

    re:
    > When I try to import it into a database interface namespace,
    > I get an error on compilation that says it's undefined


    How are you importing the namespace ?

    The correct way to import a namespace in the page directive is :

    <%@ Import Namespace="YourNameSpace" %>
    Then, in your Page_Load, or any event handler, you can call any class in your namespace :

    Sub Page_Load(Sender As Object, E As EventArgs)
    Dim YourNewInstanceName as new YourClassName()
    ' rest of your code
    End Sub




    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "JimO" <> wrote in message
    news:c94dg.4542$...
    > Yes. I even placed the source code of the database module there just to see
    > if that would work.
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> Is the utility dll located in the /bin directory of your application ?
    >>
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> aspnetfaq.com : http://www.aspnetfaq.com/
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ===================================
    >> "JimO" <> wrote in message
    >> news:_7Ncg.6938$...
    >> >I have a namespace called utility that I compiled using the /t:library
    >> > switch. It compiles fine. When I try to import it into a database
    >> > interface namespace, I get an error on compilation that says it's

    > undefined
    >> > and then one that says the class has no public members or cannot be

    > found.
    >> >
    >> > Thanks,
    >> > Jim
    Juan T. Llibre, May 24, 2006
    #4
  5. JimO

    JimO Guest

    I'm importing the utility namespace into another namespace called
    TestDBInterface.
    I can import it into the codebehind module fine, but I'd rather call it from
    the database module. I'd like to be able to import using the same method
    used to import other namespaces like system.io etc.. since I will probably
    use the code in other programs. Here is what I'm trying to do...

    utility.vb File... compiles fine

    Namespace Utility

    Public Class ValidationClass

    Public Function

    End Function

    End Class

    End Namespace


    ---------------------------------------------
    testdbinterface.vb File...

    Imports Utility

    Namespace TestDBInterface

    Public Class DBInterface
    Public Sub InsertUser(User As Object)

    Dim v As ValidationClass = New ValidationClass()
    JimO, May 25, 2006
    #5
  6. re:
    > Dim v As ValidationClass = New ValidationClass()


    I have always instantiated my clesses using this syntax :

    > Dim YourNewInstanceName as new YourClassName()


    Could you try using :

    Dim v As New ValidationClass()

    ?




    Juan T. Llibre, asp.net MVP
    aspnetfaq.com : http://www.aspnetfaq.com/
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ===================================
    "JimO" <> wrote in message
    news:dv8dg.6478$...
    > I'm importing the utility namespace into another namespace called
    > TestDBInterface.
    > I can import it into the codebehind module fine, but I'd rather call it from
    > the database module. I'd like to be able to import using the same method
    > used to import other namespaces like system.io etc.. since I will probably
    > use the code in other programs. Here is what I'm trying to do...
    >
    > utility.vb File... compiles fine
    >
    > Namespace Utility
    >
    > Public Class ValidationClass
    >
    > Public Function
    >
    > End Function
    >
    > End Class
    >
    > End Namespace
    >
    >
    > ---------------------------------------------
    > testdbinterface.vb File...
    >
    > Imports Utility
    >
    > Namespace TestDBInterface
    >
    > Public Class DBInterface
    > Public Sub InsertUser(User As Object)
    >
    > Dim v As ValidationClass = New ValidationClass()
    > .
    > .
    > End Sub
    >
    > End Class
    >
    > End Namespace
    >
    > When I compile the testdbinterface as a dll, the Imports Utility gives me a
    > warning that the namespace does not have any public members or it cannot be
    > found. When I try to instantiatea new object, I get an undefined error.
    >
    >
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> Source code placed in the /bin directory won't get compiled.
    >>
    >> re:
    >> > When I try to import it into a database interface namespace,
    >> > I get an error on compilation that says it's undefined

    >>
    >> How are you importing the namespace ?
    >>
    >> The correct way to import a namespace in the page directive is :
    >>
    >> <%@ Import Namespace="YourNameSpace" %>
    >> Then, in your Page_Load, or any event handler, you can call any class in

    > your namespace :
    >>
    >> Sub Page_Load(Sender As Object, E As EventArgs)
    >> Dim YourNewInstanceName as new YourClassName()
    >> ' rest of your code
    >> End Sub
    >>
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> aspnetfaq.com : http://www.aspnetfaq.com/
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ===================================
    >> "JimO" <> wrote in message
    >> news:c94dg.4542$...
    >> > Yes. I even placed the source code of the database module there just to

    > see
    >> > if that would work.
    >> >
    >> > "Juan T. Llibre" <> wrote in message
    >> > news:...
    >> >> Is the utility dll located in the /bin directory of your application ?
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> Juan T. Llibre, asp.net MVP
    >> >> aspnetfaq.com : http://www.aspnetfaq.com/
    >> >> asp.net faq : http://asp.net.do/faq/
    >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> ===================================
    >> >> "JimO" <> wrote in message
    >> >> news:_7Ncg.6938$...
    >> >> >I have a namespace called utility that I compiled using the /t:library
    >> >> > switch. It compiles fine. When I try to import it into a database
    >> >> > interface namespace, I get an error on compilation that says it's
    >> > undefined
    >> >> > and then one that says the class has no public members or cannot be
    >> > found.
    >> >> >
    >> >> > Thanks,
    >> >> > Jim

    >>
    >>

    >
    >
    Juan T. Llibre, May 25, 2006
    #6
  7. JimO

    Guest

    I tried it and I got the same error. ValidationClass() is not defined.


    Juan T. Llibre wrote:
    > re:
    > > Dim v As ValidationClass = New ValidationClass()

    >
    > I have always instantiated my clesses using this syntax :
    >
    > > Dim YourNewInstanceName as new YourClassName()

    >
    > Could you try using :
    >
    > Dim v As New ValidationClass()
    >
    > ?
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > aspnetfaq.com : http://www.aspnetfaq.com/
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ===================================
    > "JimO" <> wrote in message
    > news:dv8dg.6478$...
    > > I'm importing the utility namespace into another namespace called
    > > TestDBInterface.
    > > I can import it into the codebehind module fine, but I'd rather call itfrom
    > > the database module. I'd like to be able to import using the same method
    > > used to import other namespaces like system.io etc.. since I will probably
    > > use the code in other programs. Here is what I'm trying to do...
    > >
    > > utility.vb File... compiles fine
    > >
    > > Namespace Utility
    > >
    > > Public Class ValidationClass
    > >
    > > Public Function
    > >
    > > End Function
    > >
    > > End Class
    > >
    > > End Namespace
    > >
    > >
    > > ---------------------------------------------
    > > testdbinterface.vb File...
    > >
    > > Imports Utility
    > >
    > > Namespace TestDBInterface
    > >
    > > Public Class DBInterface
    > > Public Sub InsertUser(User As Object)
    > >
    > > Dim v As ValidationClass = New ValidationClass()
    > > .
    > > .
    > > End Sub
    > >
    > > End Class
    > >
    > > End Namespace
    > >
    > > When I compile the testdbinterface as a dll, the Imports Utility gives me a
    > > warning that the namespace does not have any public members or it cannot be
    > > found. When I try to instantiatea new object, I get an undefined error.
    > >
    > >
    > >
    > > "Juan T. Llibre" <> wrote in message
    > > news:...
    > >> Source code placed in the /bin directory won't get compiled.
    > >>
    > >> re:
    > >> > When I try to import it into a database interface namespace,
    > >> > I get an error on compilation that says it's undefined
    > >>
    > >> How are you importing the namespace ?
    > >>
    > >> The correct way to import a namespace in the page directive is :
    > >>
    > >> <%@ Import Namespace="YourNameSpace" %>
    > >> Then, in your Page_Load, or any event handler, you can call any class in

    > > your namespace :
    > >>
    > >> Sub Page_Load(Sender As Object, E As EventArgs)
    > >> Dim YourNewInstanceName as new YourClassName()
    > >> ' rest of your code
    > >> End Sub
    > >>
    > >>
    > >>
    > >>
    > >> Juan T. Llibre, asp.net MVP
    > >> aspnetfaq.com : http://www.aspnetfaq.com/
    > >> asp.net faq : http://asp.net.do/faq/
    > >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> ===================================
    > >> "JimO" <> wrote in message
    > >> news:c94dg.4542$...
    > >> > Yes. I even placed the source code of the database module there just to

    > > see
    > >> > if that would work.
    > >> >
    > >> > "Juan T. Llibre" <> wrote in message
    > >> > news:...
    > >> >> Is the utility dll located in the /bin directory of your application ?
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >> Juan T. Llibre, asp.net MVP
    > >> >> aspnetfaq.com : http://www.aspnetfaq.com/
    > >> >> asp.net faq : http://asp.net.do/faq/
    > >> >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> >> ===================================
    > >> >> "JimO" <> wrote in message
    > >> >> news:_7Ncg.6938$...
    > >> >> >I have a namespace called utility that I compiled using the /t:library
    > >> >> > switch. It compiles fine. When I try to import it into a database
    > >> >> > interface namespace, I get an error on compilation that says it's
    > >> > undefined
    > >> >> > and then one that says the class has no public members or cannot be
    > >> > found.
    > >> >> >
    > >> >> > Thanks,
    > >> >> > Jim
    > >>
    > >>

    > >
    > >
    , May 26, 2006
    #7
    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. Flip
    Replies:
    3
    Views:
    972
    Tony Morris
    Feb 9, 2004
  2. Steve Kershaw
    Replies:
    1
    Views:
    354
    Brennan Stehling
    Sep 26, 2006
  3. OldButStillLearning

    Now You See It Now You Don't

    OldButStillLearning, Dec 11, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    298
    Juan T. Llibre
    Dec 12, 2007
  4. C__chp
    Replies:
    4
    Views:
    503
    Puppet_Sock
    Feb 15, 2008
  5. winter heat
    Replies:
    0
    Views:
    99
    winter heat
    Nov 1, 2010
Loading...

Share This Page