question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'dotnet pack -o .' places NuGet packages in project folder

See original GitHub issue

Steps to reproduce

dotnet pack -o . src\project\project.csproj

Expected behavior

NuGet packages are placed in current folder as specified with -o . This worked properly using preview2 tooling (1.0.0-preview2-003131) and project.json.

Actual behavior

NuGet packages are placed in src\project.

Environment data

dotnet --info output: .NET Command Line Tools (1.0.0-preview3-004056)

Product Information: Version: 1.0.0-preview3-004056 Commit SHA-1 hash: ccc4968bc3

Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:10
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

15reactions
eerhardtcommented, Feb 9, 2017

I just hit this as well with dotnet publish -o. My opinion is the CLI should be taking relative paths and making them into full paths relative to the current working directory, then passing that into MSBuild.

Every command-line application I am familiar with uses paths relative to the current working directory. Not relative to some arbitrary file it is operating on.

One last thing, if we ship 1.0 like this, it will be a breaking change to fix it the right way afterwards.

11reactions
nguerreracommented, Nov 21, 2016

I think it makes sense for direct msbuild invocation and dotnet.exe invocation to differ here. In the msbuild case, there is an explicit /p argument, and so it seems reasonable that this works as it always has. But the help for dotnet -o says:

  -o|--output <OUTPUT_DIR>            Directory in which to place outputs

From that alone, it is more surprising that -o . does what it currently does.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack command - .NET CLI
The dotnet pack command builds the project and creates NuGet packages. The result of this command is a NuGet package (that is, a...
Read more >
'dotnet pack -o .' places NuGet packages in project folder · ...
NuGet packages are placed in current folder as specified with -o . This worked properly using preview2 tooling (1.0.0-preview2-003131) and ...
Read more >
Create a NuGet package with the dotnet CLI
Read a detailed guide about the process of designing and creating a NuGet package, including key decision points like files and versioning.
Read more >
Include both Nuget Package References *and* project ...
Recently I have been trying to generate more Nuget packages for our dotnet core projects, utilizing the dotnet pack command. One issue I...
Read more >
Add a package with a local package file in 'dotnet'
NuGet can only install and restore from feeds, so you'll need to add the directory where the package is in as a feed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found