title: How to get the installation directory in C# after deploying dll's
body: <p>Is there some smart way to retreive the installation path when working within a dll (C#) which will be called from an application in a different folder?</p>
  
  <p>I'm developing an add-in for an application. My add-in is written in C#. The application that will use is written in C and needs to compile some stuff during evaluation, so I have a middlestep with a C++ dll that handles the interop business with C# and only shows a clean interface outward that C can work with.</p>
  
  <p>What I deploy will be a set of .dll's and a .lib and .h for the C++ part (sometimes static binding will be necessary). </p>
  
  <p>When trying out the setup and printing out the current directory info from the C# dll with:</p>
  
  <pre><code>        Console.WriteLine(Directory.GetCurrentDirectory());
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>        Console.WriteLine(System.Environment.CurrentDirectory);
  </code></pre>
  
  <p>I get the executables path.</p>
  
  <p>So ... once again, how do I get the installation path of my dll?</p>
  
  <p>Edit: They both worked! Thanks for the quick reply guys!</p>