Read/Write Parent Application Config using C#
<p>I am trying to read my parent application config inside my class library but getting error.
My application hierarchic is like this</p>

<p>Executable Application(MS Test Project) > Service(Class Library) > DataAccess(Class Library)</p>

<p>Now my App.config is inside my Executable Application(MS Test Project) and i am tying to read inside DataAccess(Class Library) using following command.</p>

<pre><code> System.Configuration.Configuration _config1 = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
</code></pre>

<blockquote>
  <p>Error:- An error occurred loading a configuration file: Type is not
  resolved for member
  'Castle.DynamicProxy.Serialization.ProxyObjectReference,Moq,
  Version=4.0.10827.0, Culture=neutral,
  PublicKeyToken=69f491c39445e920'.</p>
</blockquote>

<p>Please suggest me is there any other way?</p>

<p><strong>Modified....</strong></p>

<p>Now to fix this Problem, i did like this</p>

<pre><code>   var path = System.AppDomain.CurrentDomain.GetAssemblies().Where(p =&gt; !p.GlobalAssemblyCache &amp;&amp; p.ImageRuntimeVersion.Contains("v" + System.Environment.Version.ToString().Substring(0, System.Environment.Version.ToString().LastIndexOf(".")))).FirstOrDefault().Location;
                              _config = ConfigurationManager.OpenExeConfiguration(path);
</code></pre>

<p>It is working for me, but still is there any other way???</p>
