Search code examples
msbuildnuget

How do I set the OutputDirectory for msbuild pack?


Previously using Nuget, one could run nuget pack -OutputDirectory ../../output for example. How can I do this with msbuild pack? I am using VS2017.


Solution

  • dotnet pack has an option to set the output path:

    $ dotnet pack -h
      ...
        -o, --output <OUTPUT_DIR>             Directory in which to place built packages.
    

    So you can do dotnet pack -o ../artifacts/packages