title: Project generates a nuget package that depends on another project that does not create a nuget package
body: <p>If I have a project (P1) that builds a nuget package, and I make it depend on a project (P2) that doesn't build a nuget package, the generated package will still reference P2 <em>as a nuget package</em>.</p>
  
  <h1>Steps to reproduce</h1>
  
  <ul>
  <li>Create a solution with 2 C# projects (P1 and P2)</li>
  <li>Make P1 depend on P2.</li>
  <li><p>Add the following line to P1.csproj (to make it build a nuget package)</p>
  
  <p><code>&lt;GeneratePackageOnBuild&gt;true&lt;/GeneratePackageOnBuild&gt;</code></p></li>
  <li>Build the solution</li>
  <li>Open the generated P1.nupkg in, e.g., <a href="https://www.microsoft.com/en-us/p/nuget-package-explorer/9wzdncrdmdm3" rel="noreferrer">NuGet Package Explorer</a></li>
  </ul>
  
  <p>Note that the NuGet package depends on another NuGet package called P2. However, that package does not exist, and will never exist, as I have not told the P2 project to build a nuget package.</p>
  
  <h1>Question</h1>
  
  <p>How do I force P2.dll to be included in P1.nupkg's <code>lib</code> folder? Ideally it will force it only for references that <em>don't</em> create a nuget package themselves.</p>
  
  <h1>Other questions</h1>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/45676872/package-net-standard-library-as-nuget-package-and-include-all-project-dependenc">Package .NET Standard library as Nuget package and include all project dependencies / references</a> is related, but assumes the use of <code>nuget pack</code>. I am using <code>dotnet build</code> or Visual Studio to build the nuget package, so doesn't apply.</li>
  <li><a href="https://github.com/nuget/home/issues/3891" rel="noreferrer">This GitHub query</a> is pretty much the same as my issue.</li>
  </ul>