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

J

JimO

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
 
J

JimO

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

Juan T. Llibre

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
 
J

JimO

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()
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top