Assembly folder?

  • Thread starter Thread starter Ivan
  • Start date Start date
I

Ivan

How do I determine assembly folder? I know about
Environment.CurrentDirectory but it returns directory where process stared.
I need directory where my DLL located (Code runs inside DLL)

Thank you,
Ivan
 
Ivan,

You can use Reflection to obtain the current assembly's information.

string filePath =
System.Reflection.Assembly.GetExecutingAssembly().Location;
string folderPath = System.IO.Path.GetDirectoryName(filePath);

// Make use of folderPath here.
 
Back
Top