title: C# DLL config file not present
body: <p>Well, this question is a bit different from others with the slightly same title.</p>
  
  <p>I add a config file to my DLL which will be used from a website and a console application.
  I'm testing the DLL from my web application.</p>
  
  <p>When I build the DLL I can see my <code>MyApp.dll.config</code> in the <code>bin\debug</code> folder.</p>
  
  <p>Nevertheless, when I try to read the settings from the DLL this way:</p>
  
  <pre><code>var appConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location);
  </code></pre>
  
  <p>The file is not found.
  I know it is something to do with the location where the application is being executed as <code>Assembly.GetExecutingAssembly().Location</code> return a path in <code>Framework\v4.0.30319\Temporary ASP.NET Files\root\...</code> while <code>AppDomain.CurrentDomain.BaseDirectory</code> return another completely different path.</p>
  
  <p>So, what I'm doing wrong? There is some configuration missing to get the config file to be copied in the real location where the application is being ran?</p>
  
  <p>Thank you in advance from your help!</p>