Skip to content

dotnet pack fails when PackAsTool is true and project has ProjectReference's #2047

@natemcmaster

Description

@natemcmaster

Repro
Create a console app project with a ProjectReference to a class library.

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <ProjectReference Include="..\ClassLib1\ClassLib1.csproj" />
  </ItemGroup>

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <PackAsTool>true</PackAsTool>
  </PropertyGroup>

</Project>

dotnet pack

Expected
Creates a tool package with ClassLib1.dll bundled inside

Actual
dotnet pack fails with this error

C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): error : Could not find a part of the path 'C:\Users\nmcmaster\AppData\Local\Temp\ClassLib1\bin\Debug\netcoreapp2.1\publish'. [C:\Users\nmcmaster\AppData\Local\Temp\test2\test2.csproj]

cc @wli3 @peterhuene @KathleenDollard

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions