title: How to use a custom name for app.config or hard-code config values in my assembly
body: <p>I have written a class library in C# (mydll.dll) which accesses a third party dll (3rdpdll.dll). Mydll.dll, in turn gets consumed via COM interop by a non-.NET process (myapp.exe).</p>
  
  <p>Mydll.dll is .NET 4.0 but 3rdpdll.dll has been built using v2.0.50727, so when I run myapp.exe, I get the following error:</p>
  
  <blockquote>
    <p>Mixed mode assembly is built against version 'v2.0.50727' of the
    runtime and cannot be loaded in the 4.0 runtime without additional
    configuration information...</p>
  </blockquote>
  
  <p>This gets fixed if I create a file called "myapp.exe.config" next to myapp.exe containing the following XML:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;startup useLegacyV2RuntimeActivationPolicy="true"&gt;
      &lt;supportedRuntime version="v4.0"/&gt;
    &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Problem is myapp.exe gets updated a lot and contains version information in the name, such as myapp.v2.063.exe. This would require the config file to be renamed with every new iteration of the app (myapp.v2.063.exe.config
  ).</p>
  
  <p>Is there a way for me to declare a static name for the config file, such as "app.config" so that it does not need to be renamed and reshipped along with every new iteration of myapp.exe? Or better yet, could I hard-code the useLegacyV2RuntimeActivationPolicy attribute in mydll.dll so that I can avoid using a config file altogether?</p>