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 fails when PackAsTool is true and project has ProjectReference's

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
natemcmastercommented, Mar 16, 2018

Thanks. @bricelam the latest KoreBuild should have this SDK now

1reaction
wli3commented, Mar 15, 2018

Unfortunately the change has not been flowed to CLI. I’ll create a PR for it. And let you know when there is a good build

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet pack fails when `GeneratePackageOnBuild` is `true`
Using this simple repo: https://github.com/daniefer/dotnetcliissue When the true project attribute is specified and the project has not been ...
Read more >
dotnet pack project references
Project-to-project references aren't packaged inside the project. Currently, you must have a package per project if you have project-to-project ...
Read more >
Dotnet pack - include referenced projects
Shows how to workaround the current limitations of dotnet pack when referencing other projects.
Read more >
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 >
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.
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