title: Canot resolve dependency via NuGet
body: <p>I have a C#-project that is using a 3rd-party dependency as well as some of my own assemblies.</p>
  <p>All of those assemblies are located within my <code>CommonBinPath</code> in <code>C:\repo\bin</code>.</p>
  <p>Now for the sake of gaining experience using NuGet also I plan to consume some of those dependencies - essentially all assemblies from third parties - via out NuGet-server.</p>
  <p>So I have the following references within my project-file:</p>
  <pre><code>&lt;PropertyGroup&gt;
      &lt;CommonBinPath Condition=&quot;'$(CommonBinPath)' == ''&quot;&gt;$(MSBuildProjectDirectory)\bin\Debug&lt;/CommonBinPath&gt;
      &lt;OutputPath&gt;$(CommonBinPath)\&lt;/OutputPath&gt;
  &lt;/PropertyGroup&gt; 
  &lt;ItemGroup&gt;
    &lt;PackageReference Include=&quot;ESRI.ArcGIS.Geodatabase&quot;&gt;
      &lt;Version&gt;*&lt;/Version&gt;
    &lt;/PackageReference&gt;
    &lt;Reference Include=&quot;GeoDataServer&quot;&gt;
      &lt;SpecificVersion&gt;False&lt;/SpecificVersion
      &lt;HintPath&gt;$(CommonBinPath)\GeoDataServer.dll&lt;/HintPath&gt;
    &lt;/Reference&gt;
  &lt;/ItemGroup&gt;
  </code></pre>
  <p>So the ArcGIS-assembly can be found under <code>CommonBinPath</code> as well as on our server. However when I compile that project neither can be found and I get namespace not found errors.</p>
  <p>From my msbuild-log:</p>
  <pre><code>ResolveAssemblyReference-target
    Dependency &quot;ESRI.ArcGIS.Geodatabase, Version=10.6.0.0, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86&quot;.
        The resolved path is &quot;C:\repo\bin\ESRI.ArcGIS.Geodatabase.dll&quot;.
        A reference was found in path &quot;C:\repo\bin&quot;.
            For SearchPath &quot;C:\repo\bin&quot;.
            Considered &quot;C:\repo\bin\ESRI.ArcGIS.Geodatabase.winmd&quot;, but it didn't exist.
        Required by &quot;GeoDataServer&quot;.
  </code></pre>
  <p>This is just the translated version from my german log-file, I hope I got the correct keywords.</p>
  <p>So obviously during the <code>ResolveAssemblyReference</code>-target the reference is found within my local file-system. So far so good.</p>
  <p>However during <code>Csc</code> I get this:</p>
  <pre><code>Target &quot;CoreCompile&quot; in File &quot;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets&quot; from project &quot;C:\MyProject.csproj&quot; (Target &quot;Compile&quot; depends on it):
  The target &quot;CoreCompile&quot; will be created.
  The output-file &quot;obj\x86\Debug\MyProject.dll&quot; does not exist
  The Csc-target from C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll will be used.
  Csc-target
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /unsafe- /checked- /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /baseaddress:285212672 /define:FI60 /highentropyva+ /reference:C:\repo\bin\GeoDataServer.dll /reference:&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\mscorlib.dll&quot; /reference:&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Core.dll&quot; /reference:&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.dll&quot; /reference:&quot;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.1\System.Xml.dll&quot; /debug+ /debug:full /filealign:4096 /optimize- /out:obj\x86\Debug\MyProject.dll /ruleset:&quot;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset&quot; /subsystemversion:6.00 /target:library /warnaserror- /utf8output GeometryAssert.cs Properties\AssemblyInfo.cs &quot;C:\Users\utvm-admin\AppData\Local\Temp\.NETFramework,Version=v4.5.1.AssemblyAttributes.cs&quot;
    ...
  GeometryAssert.cs(9,7): error CS0246: The type or namespace &quot;ESRI&quot; could not be found (maybe you are missing a using-directive). [C:\MyProject.csproj]
  </code></pre>
  <p>I´m doing this on our jenkins-server where no VS is installed, but the VS Build Tools 2019. However on my own machine where I have a &quot;full&quot; VS2017 installed everfthing works fine (of course I have the appropriate <code>using</code> within my file).</p>
  <p>EDIT: I realized the <code>ResolveNuGetPackageAssets</code>-target, that is executed directly before <code>ResolveAssemblyReference</code>, was omitted, &quot;because the condition was false&quot;:</p>
  <pre><code>('$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')) evaluated to ('true' == 'true' and exists('obj\project.assets.json'))
  </code></pre>
  <p>However I would expect the dependencies to be resolved by <code>ResolveAssemblyReference</code> if they were not already resolved during <code>ResolveNuGetPackageAssets</code>. Is this wrong? How do those two targets relate?</p>