title: Could not resolve this reference: NuGet on CI server
body: <p>I'm running a CI build on a TFS build controller, connected to VS Online. I've got a 'Could not resolve this reference' problem for a NuGet package and I've observed behavior that I haven't seen before:</p>
  
  <p>Locally the pacakage is downloaded to <code>packages\FluentValidation.5.5.0</code> whereas on the server,  it's downloaded to <code>packages\FluentValidation.5.5.0.0</code>.</p>
  
  <p>Packages.config:</p>
  
  <pre><code>&lt;package id="FluentValidation" version="5.5.0" targetFramework="net45" userInstalled="true" /&gt;
  </code></pre>
  
  <p>.csproj file <code>$(SolutionDir)</code> for shared project - works for all the other projects:</p>
  
  <pre><code>&lt;Reference Include="FluentValidation, Version=5.5.0.0, Culture=neutral, processorArchitecture=MSIL"&gt;     
  &lt;HintPath&gt;$(SolutionDir)\packages\FluentValidation.5.5.0\lib\Net40\FluentValidation.dll&lt;/HintPath&gt;
    &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
    &lt;Private&gt;True&lt;/Private&gt;
  &lt;/Reference&gt;
  </code></pre>
  
  <p>Nuget package restore is enabled, so if I locally remove the package from the packages folder and rebuild - works fine.</p>
  
  <p>Now on the CI server. Build diagnostics log states:</p>
  
  <blockquote>
    <p>Installing 'FluentValidation 5.5.0.0'. 
    ... 
    Successfully installed 'FluentValidation 5.5.0.0'.</p>
  </blockquote>
  
  <p>But then further in build log:</p>
  
  <blockquote>
    <p>16>C:\Program Files
    (x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets(1697,5):
    warning MSB3245: Could not resolve this reference. Could not locate
    the assembly "FluentValidation". Check to make sure the assembly
    exists on disk. If this reference is required by your code, you may
    get compilation errors. [C:\Builds\24353... stuff...\projectfile.csproj]
                     For SearchPath "{HintPathFromItem}".
                     Considered "C:\Builds\24353... stuff ...\packages\FluentValidation.5.5.0\lib\Net40\FluentValidation.dll",</p>
  </blockquote>
  
  <p>As expected - there's not package in that folder </p>
  
  <p><code>C:\Builds\24353\... stuff ...\packages\FluentValidation.5.5.0\lib\Net40\</code>.</p>
  
  <p>However - that's because it is downloaded into a different folder on the CI server: </p>
  
  <p><code>C:\Builds\24353\... stuff ...\packages\FluentValidation.5.5.0.0\lib\Net40\</code>.</p>
  
  <p>( note the extra .0 behind the package folder name ).</p>
  
  <p>I have no idea where that extra .0 comes from. Also the project seems to ignore the build path. 
  The CI server has VS 2013 on it and I updated NuGet on the box, didn't help. There's only 1 place where there's 5.5.0.0 ( with 2 zeros ) that's in the reference. I removed the trailing .0. Solution still builds locally, but not on CI. </p>
  
  <p><img src="https://i.stack.imgur.com/udpwM.png" alt="local packages folder left - server right"></p>
  
  <p><strong>Update</strong>
  Adding a 2nd hintpath in the .csproj file seems to fix the build on CI server, but breaks it locally. I really can't get my head around why it's v5.0.0 locally and v5.0.0.0 on the CI server.</p>
  
  <p><strong>P.S.</strong> I've reported it as bug: <a href="https://github.com/NuGet/Home/issues/504" rel="nofollow noreferrer">https://github.com/NuGet/Home/issues/504</a> </p>