Skip to content

Cannot build project with PackAsTool=true and GeneratePackageOnBuild=true  #2114

@natemcmaster

Description

@natemcmaster

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]

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions