How do I get the directory of the class library

G

Guest

I am building an application that uses a windows service that calls a .net
class library. From within the class library, how do I get the directory of
the class library ?

Thanks,
Craig
 
R

Richard Grimes

Craig said:
I am building an application that uses a windows service that calls a
.net class library. From within the class library, how do I get the
directory of the class library ?

The class library will either be in the process's folder (or a folder
underneath that) or in the GAC. You should *not* install libraries
anywhere else.

If it's in the GAC then you should not be concerned with the 'directory'
of the library because that is an implementation detail of how the GAC
works.

Every assembly has a CodeBase property that gives the location of the
assembly, but I am unsure why you would need to know this. The reason is
that you really should allow Fusion to handle the location of
assemblies.

Richard
 

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

Top