_From @robertmuehsig on October 29, 2017 21:28_
The documentation tells me that "dotnet pack" should build the project (https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-pack?tabs=netcore2x)
Unfortunatly this behaviour is missing if I enable the "create nuget package on build":

When I now execute dotnet pack, it fails:

Repo steps:
_Copied from original issue: dotnet/sdk#1698_
"Generate NuGet Package on build" is a build property and dotnet build should create the NuGet package by calling pack target in MSBuild.
dotnet pack should just work with/without the  "Generate NuGet Package on build" property
Tried the scenario now and it indeed is a bug.
dotnet pack works finedotnet pack does not work.This is likely by design (https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Build.Tasks.Pack/Pack.targets#L38), probably adding Build as a target dependency causes a circular dependency (after Build, Pack is called, which would call Build).
Anyway, this is definitely a bug and it can probably be fixed.
closing it by design
At the very least, the documentation of dotnet pack should be updated to make this behavior clear.
Most helpful comment
At the very least, the documentation of
dotnet packshould be updated to make this behavior clear.