.dll startup path

  • Thread starter Thread starter kids_pro
  • Start date Start date
K

kids_pro

Hi there,

I develop a small .dll file.
When I deploy the dll I also attach a xsd file in the same folder.
I try to load the xsd file from the client code (window form) but I don't
know how to start it give me the wrong path.

I am not sure which namespace can give me the method to get the path.
Please advice.

Thank,
kids
 
Hi Kids,

In simple terms, this will give you the base directory your application was
started from:

AppDomain.CurrentDomain.BaseDirectory

Joe
 
Hi,

The better way is to find any of your DLL types and then
find its assembly location e.g.:

Type type=type(MyDllType);
string dllPath=type.Assembly.Location;

It will work even if you register your DLL.

Cheers!

Marcin
 
Back
Top