title: NuGet update and conditional references
body: <p>Our nupkg packages contain multiple versions of the same dll (x86, x64, AnyCPU) and in the csproj files, in references I use conditional references to pick a specific dll depending on the current platform set. As a result I have multiple references to the same library (just different platform compilation).</p>
  
  <p>here's a fragment of my csproj file:</p>
  
  <pre><code>&lt;Reference Include="xxxx" Condition="'$(Platform)'=='x86'"&gt;            
     &lt;HintPath&gt;..\..\packages\xxxx.2.7.0.1093\lib\net45\x86\xxxx.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="xxxx" Condition="'$(Platform)'=='x64'"&gt;
    &lt;HintPath&gt;..\..\packages\xxxx.2.7.0.1093\lib\net45\x64\xxxx.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="xxxx" Condition="'$(Platform)'=='AnyCPU'"&gt;
    &lt;HintPath&gt;..\..\packages\xxxx.2.7.0.1093\lib\net45\AnyCPU\xxxx.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  </code></pre>
  
  <p>This construction works very well in both MSBuild and in Visual Studio.</p>
  
  <p>Unfortunately after <em>nuget update</em> the csproj references get messed up. Here's the result:</p>
  
  <pre><code>&lt;Reference Include="xxxx" Condition="'$(Platform)'=='x86'"&gt;
    &lt;HintPath&gt;..\..\packages\xxxx.2.7.0.1093\lib\net45\x86\xxxx.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="xxxx" Condition="'$(Platform)'=='x64'"&gt;
    &lt;HintPath&gt;..\..\packages\xxxx.2.7.0.1093\lib\net45\x64\xxxx.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  &lt;Reference Include="xxxx"&gt;
    &lt;HintPath&gt;..\..\packages\xxxx.2.7.0.1094\lib\net45\x86\xxxx.dll&lt;/HintPath&gt;
  &lt;/Reference&gt;
  </code></pre>
  
  <p>So looks like only one reference got updated and... the <em>Condition</em> section got dropped as well as the first dll on the list was used.</p>
  
  <p>Not what I was expecting. Any ideas how to best work around that problem? Anyone using conditional references in your csproj's with nuget? Any advice would be greatly appreciated!</p>