title: How to pack .NET Core projects recursively without running pack on the entire solution?
body: <p>I have a solution of a hundred plus .NET Core projects. Not all of them needs to be packed, but only those which are transitive dependencies of a few special projects. </p>
  
  <p>However, when I run <code>dotnet pack</code> it attempts to pack all kinds of projects that it should not and there are errors here and there. I would like instead to run pack on the special projects only in a recursive fashion, so that only them and their transitive dependencies (project references, of course) are packed.</p>
  
  <p>I figured I can implement it by scripting around the <code>dotnet list reference</code> command, but it does not sound right. There must be a better way to do it.</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>The solution must work on the command line where we have dotnet and msbuild and possibly nuget, but no VS IDE.</p>