tofutim
tofutim

Reputation: 23374

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.

Upvotes: 17

Views: 8444

Answers (2)

bernhof
bernhof

Reputation: 6310

Just to confirm what is mentioned in the comments: you can specify /p:PackageOutputPath="c:\output" in which case the .nupkg files will be created in the "c:\output" directory.

Upvotes: 42

Martin Ullrich
Martin Ullrich

Reputation: 100543

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

Upvotes: 4

Related Questions