retrieving path for a class library

R

Roger

How do you create the path the class library resides in. Using the
Environment.CurrentDirectory does not always pull the physical path that the
DLL resides in when the DLL is called from Biztalk. The path is
C:\windows\system32. Byt I have my dll somewhere else. Is there a property
that can pull the directory the dll physically resides in?>
 
N

Nicholas Paldino [.NET/C# MVP]

Roger,

You can get the Assembly instance for the DLL and then use the CodeBase
property. Note, that if the assembly is loaded from the GAC, the CodeBase
property is not guaranteed to be populated, but the Location property is.

For more details, see the following blog entry from Suzanne Cook on the
matter:

http://blogs.msdn.com/suzcook/archive/2003/06/26/57198.aspx
 

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