title: How to create nuget package with msbuild without rebuilding project?
body: <p>I would like to setup a CI/CD pipeline with build, test and deploy stages.
  I can build my project in build stage with</p>
  
  <pre><code>msbuild src\MyProject.csproj /t:Restore 
  msbuild src\MyProject.csproj /p:Configuration=Release /p:OutputPath=../BuildOutput
  </code></pre>
  
  <p>Next I will build and run tests against <code>..\BuildOutput\MyProject.dll</code> that has already been built.</p>
  
  <pre><code>msbuild tests\MyProject.Tests.csproj /t:Restore
  msbuild tests\MyProject.Tests.csproj /p:Configuration=Release /p:OutputPath=../BuildOutput /p:BuildProjectReferences=false
  vstest.console BuildOutput\MyProject.Tests.dll
  </code></pre>
  
  <p>Up to this point it seems to work.</p>
  
  <p>Now I would like to generate nuget package.
  I can call:</p>
  
  <pre><code>msbuild src\MyProject.csproj /t:Pack /p:Configuration=Release /p:OutputPath=../BuildOutput /p:VersionPrefix=1.2.3
  </code></pre>
  
  <p>And that would create <code>MyProject.1.2.3.nupkg</code> in <code>BuildOutput</code> folder.
  However it re-builds that project.</p>
  
  <p>I'm looking something similar to <code>dotnet</code> cli.</p>
  
  <pre><code>dotnet pack --no-build
  </code></pre>
  
  <p>But I cannot use <code>dotnet</code> because my project has a COM reference.</p>
  
  <p>I also looked into Nuget.exe, but it seems to throw an error when I call <code>nuget pack</code></p>
  
  <pre><code>Unable to cast object of type 'System.String' to type NuGet.Frameworks.NuGet.Frameworks1051960.NuGetFramework'.
  </code></pre>
  
  <p><strong>Does msbuild have a property that can skip build?</strong></p>