Repro
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PackAsTool>true</PackAsTool>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>
</Project>
dotnet build
Expected
Build the project and produce a nupkg.
Actual
dotnet build fails
C:\Program Files\dotnet\sdk\2.1.300-preview2-008523\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(326,5): error MSB4006: There is a circular dependency in the target dependency graph involving target "_WalkEachTargetPerFramework". [C:\dev\natemcmaster\tmp\tmp.csproj]
Repro
dotnet buildExpected
Build the project and produce a nupkg.
Actual
dotnet buildfails