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

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

P: n/a
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 23 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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" <jo************@DEF-earthlink.net> wrote in message
news:_7****************@newsread2.news.pas.earthli nk.net...
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 24 '06 #2

P: n/a
Yes. I even placed the source code of the database module there just to see
if that would work.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u3**************@TK2MSFTNGP02.phx.gbl...
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" <jo************@DEF-earthlink.net> wrote in message
news:_7****************@newsread2.news.pas.earthli nk.net...
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 24 '06 #3

P: n/a
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" <jo************@DEF-earthlink.net> wrote in message
news:c9*****************@newsread4.news.pas.earthl ink.net... Yes. I even placed the source code of the database module there just to see
if that would work.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:u3**************@TK2MSFTNGP02.phx.gbl...
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" <jo************@DEF-earthlink.net> wrote in message
news:_7****************@newsread2.news.pas.earthli nk.net...
>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 24 '06 #4

P: n/a
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()
May 25 '06 #5

P: n/a
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" <jo************@DEF-earthlink.net> wrote in message
news:dv****************@newsread3.news.pas.earthli nk.net... 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" <no***********@nowhere.com> wrote in message
news:OH**************@TK2MSFTNGP05.phx.gbl...
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" <jo************@DEF-earthlink.net> wrote in message
news:c9*****************@newsread4.news.pas.earthl ink.net...
> Yes. I even placed the source code of the database module there just to see > if that would work.
>
> "Juan T. Llibre" <no***********@nowhere.com> wrote in message
> news:u3**************@TK2MSFTNGP02.phx.gbl...
>> 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" <jo************@DEF-earthlink.net> wrote in message
>> news:_7****************@newsread2.news.pas.earthli nk.net...
>> >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 25 '06 #6

P: n/a
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" <jo************@DEF-earthlink.net> wrote in message
news:dv****************@newsread3.news.pas.earthli nk.net...
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" <no***********@nowhere.com> wrote in message
news:OH**************@TK2MSFTNGP05.phx.gbl...
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" <jo************@DEF-earthlink.net> wrote in message
news:c9*****************@newsread4.news.pas.earthl ink.net...
> Yes. I even placed the source code of the database module there just to

see
> if that would work.
>
> "Juan T. Llibre" <no***********@nowhere.com> wrote in message
> news:u3**************@TK2MSFTNGP02.phx.gbl...
>> 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" <jo************@DEF-earthlink.net> wrote in message
>> news:_7****************@newsread2.news.pas.earthli nk.net...
>> >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 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.