title: Minor version difference in gacutil and environment causing major headaches
body: <p>Here's the situation:</p>
  
  <p>I have a DLL compiled in .NET 2 that goes in the global assembly cache.  I have the <code>myDLL.dll.config</code> file which reads:</p>
  
  <pre><code>&lt;configuration&gt;
     &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="myDLL" publicKeyToken="c426c33bab532523" /&gt;
          &lt;bindingRedirect oldVersion="1.2.2.0-1.2.2.22" newVersion="1.2.2.23" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I then use the assembly linker to create the policy file:</p>
  
  <pre><code>al /link:myDLL.dll.config /out:policy.1.2.myDLL.dll /keyfile:myDLL.snk
  </code></pre>
  
  <p>But when I try to load the policy file into the global assembly cache using</p>
  
  <pre><code>gacutil -i policy.1.2.myDLL.dll
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Failure adding assembly to the cache:  This assembly is built by a 
  runtime newer than the currently loaded runtime and cannot be loaded.  
  </code></pre>
  
  <p>The .NET Global Assembly Cache Utility version is 2.0.50727.42, but I checked the version on the build environment by creating a new C# .NET 2 console project, and executing the following:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using System.Windows.Forms;
  
  namespace ConsoleApplication1
  {
      class Program
      {
          static void Main(string[] args)
          {
              MessageBox.Show(Environment.Version.ToString());
          }
      }
  }
  </code></pre>
  
  <p>and my Environment.Version is 2.0.50727.5466.</p>
  
  <p>This is all happening on the same computer, specifically, my dev box.</p>
  
  <p>I can copy myDLL.dll from the \bin\release folder into c:\Windows\assembly folder, no problem.  But trying to either copy-past the policy.1.2.myDLL.dll file from \bin\release to \assembly, or using gacutil fails.   </p>