How to reference a dll from asmx?

M

Michael Giroux

I have an asmx that Inherits a class that is defined in a dll. The asmx and
dll are in the same directory. The asmx gets compile errors because the
class it inherits is not know. Looking at the generated compile command,
the dll is not being referenced -- there is no /R:my.dll option in the
command line.

I've been searching for several hours but cannot figure out how to cause
ASP.NET to include a /r:mydll in the compile.

Can someone point me to the docs for how to accomplish this?

Thanks

Michael Giroux
 
M

Martin Kulov

Michael Giroux said:
I've been searching for several hours but cannot figure out how to cause
ASP.NET to include a /r:mydll in the compile.

Can someone point me to the docs for how to accomplish this?

Hi Michael,

use the @ Assembly directive. I think it does exactly what you need.

Best,

--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 
M

Michael Giroux

Martin,

use the @ Assembly directive. I think it does exactly what you need.

Thanks. You are correct, the @Assembly directive is exactly what I needed
but it has one hitch that I'm not sure how to resolve.

If the code in the DLL does not have a namespace, there I cannot figure out
how to reference a DLL. I am able to reference the code as xxx.vb source
file, but when I compile the code into a DLL and reference as a dll, then
the ASMX fails to compile because the referenced class is not found.

Is there something special about using @Assembly with the default namespace?

Michael
 
M

Martin Kulov

Michael Giroux said:
If the code in the DLL does not have a namespace, there I cannot figure
out how to reference a DLL. I am able to reference the code as xxx.vb
source file, but when I compile the code into a DLL and reference as a
dll, then the ASMX fails to compile because the referenced class is not
found.

Michael,
please use Object browser to see what is your namespace in the compiled dll.
I have some doubts that it is not empty. Can you check it, please?


--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top