title: Restore locked mode fails on error NU1004: The packages lock file is inconsistent
body: <p>I have 2 C# projects: <code>Project.csproj</code> and <code>Project.Tests.csproj</code>.</p>
  <p><code>Project.Tests.csproj</code> contains <code>ProjectReference</code>:</p>
  <pre><code>&lt;ItemGroup&gt;
      &lt;ProjectReference Include=&quot;../Project/Project.csproj&quot; /&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  <p>I use floating versions of dependencies and I also enabled lock files:</p>
  <pre><code>&lt;RestorePackagesWithLockFile&gt;true&lt;/RestorePackagesWithLockFile&gt;
  &lt;DisableImplicitNuGetFallbackFolder&gt;true&lt;/DisableImplicitNuGetFallbackFolder&gt;
  &lt;RestoreLockedMode&gt;false&lt;/RestoreLockedMode&gt;
  </code></pre>
  <p>When I execute <code>dotnet restore --locked-mode</code>, I'm getting</p>
  <pre><code>/usr/share/dotnet/sdk/3.1.409/NuGet.targets(128,5): error NU1004: The packages lock file is inconsistent with the project dependencies so restore can't be run in locked mode. Disable the RestoreLockedMode MSBuild property or pass an explicit --force-evaluate option to run restore to update the lock file.
  </code></pre>
  <p>When I try suggestion <code>dotnet restore --force-evaluate</code>, it is restored correctly, there are no changes to lock files though.
  Funnily enough, when I execute <code>dotnet restore --locked-mode</code> right after, it fails on the same <code>error NU1004</code></p>
  <p>Do you have any idea how to overcome this issue?
  Is there a way to tell NuGet to provide more descriptive information why it fails?</p>