title: Replacing Microsoft.VC90.CRT WinSxS policy file with local config file
body: <p>On Windows XP, I have an .exe which runs with <code>msvcp90.dll</code>, <code>msvcr90.dll</code>, and <code>Microsoft.VC90.CRT.manifest</code> in my local application directory. I also have a policy file for these .dlls in <code>C:\WINDOWS\WinSxS\Policies</code>, which was installed by the <a href="http://www.microsoft.com/download/en/details.aspx?id=5582" rel="nofollow">Visual C++ 2008 SP1 Redistributable Package</a>. I'd like to delete this policy file and use an app config file in my local directory instead. The policy file is:</p>
  
  <pre><code>&lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt;
      &lt;assemblyIdentity type="win32-policy" name="policy.9.0.Microsoft.VC90.CRT" version="9.0.30729.1" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"/&gt;
      &lt;dependency&gt;
          &lt;dependentAssembly&gt;
              &lt;assemblyIdentity type="win32" name="Microsoft.VC90.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"/&gt;
              &lt;bindingRedirect oldVersion="9.0.20718.0-9.0.21022.8" newVersion="9.0.30729.1"/&gt;
              &lt;bindingRedirect oldVersion="9.0.30201.0-9.0.30729.1" newVersion="9.0.30729.1"/&gt;
          &lt;/dependentAssembly&gt;
      &lt;/dependency&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>My config file is:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;runtime&gt;
          &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt;
              &lt;dependentAssembly&gt;
                  &lt;assemblyIdentity type="win32" name="Microsoft.VC90.CRT" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"/&gt;
                  &lt;bindingRedirect oldVersion="9.0.20718.0-9.0.21022.8" newVersion="9.0.30729.1"/&gt;
                  &lt;bindingRedirect oldVersion="9.0.30201.0-9.0.30729.1" newVersion="9.0.30729.1"/&gt;
              &lt;/dependentAssembly&gt;
          &lt;/assemblyBinding&gt;
      &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Dependency Walker reports side-by-side errors when using the config file instead of the policy file - what's wrong? Also, should the config file be named <code>&lt;application&gt;.exe.config</code>, or <code>Microsoft.VC90.CRT.config</code>?</p>
  
  <p>(To clarify, no errors appear when using the policy file. However, the client here is not allowed to install the redistributable package.</p>
  
  <p>The <a href="http://msdn.microsoft.com/en-us/library/aa374182(VS.85).aspx" rel="nofollow">MSDN docs</a> state that an app config file can redirect the application to use different versions of the same assembly (<a href="http://msdn.microsoft.com/en-us/library/ee710783(v=VS.85).aspx" rel="nofollow">per-application configuration</a>), and that it can override an existing policy (publisher configuration) file if needed. So I think it must be possible to use a local app config file, and that something in the file above is missing or incorrect.)</p>