Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run pack when GeneratePackageOnBuild is true #3471

Closed
wli3 opened this issue Jul 26, 2019 · 1 comment
Closed

Cannot run pack when GeneratePackageOnBuild is true #3471

wli3 opened this issue Jul 26, 2019 · 1 comment

Comments

@wli3
Copy link

wli3 commented Jul 26, 2019

Create a console app. Set GeneratePackageOnBuild=true. Run dotnet pack. This bug as there since 2.0

Microsoft (R) Build Engine version 16.3.0-preview-19375-03+c19c7499a for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
  Restore completed in 130.75 ms for C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\HelloWorld.csproj.
C:\work\sdk\artifacts\bin\Debug\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(154,5): error MSB3030: Could not copy the file "C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\bin\Debug\netcoreapp2.1\HelloWorld.deps.json" because it was not found. [C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\HelloWorld.csproj]
C:\work\sdk\artifacts\bin\Debug\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(154,5): error MSB3030: Could not copy the file "obj\Debug\netcoreapp2.1\HelloWorld.dll" because it was not found. [C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\HelloWorld.csproj]
C:\work\sdk\artifacts\bin\Debug\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(154,5): error MSB3030: Could not copy the file "obj\Debug\netcoreapp2.1\HelloWorld.pdb" because it was not found. [C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\HelloWorld.csproj]
C:\work\sdk\artifacts\bin\Debug\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(154,5): error MSB3030: Could not copy the file "C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\bin\Debug\netcoreapp2.1\HelloWorld.runtimeconfig.json" because it was not found. [C:\work\sdk\artifacts\tmp\Debug\It_packs_succ---E7D10EDE\HelloWorld.csproj]
@wli3 wli3 added the Bug label Jul 26, 2019
@wli3 wli3 added this to the Backlog milestone Jul 26, 2019
wli3 pushed a commit to wli3/sdk that referenced this issue Jul 27, 2019
What I did is essentially write a different dependency graph in GeneratePackageOnBuild = true to avoid circular dependency . Original bug. I added the https://github.com/dotnet/sdk/pull/3255/files and essentially regressed NuGet/Home#7801. Instead of the logic is in nuget, it is in SDK now. Publish should not skip Build  if GeneratePackageOnBuild is true. Or it will mean no build even use Publish verb.

But revert 3255 means, dotnet#2114 will be back. The solution is to break Pack’s dependency on Build in GeneratePackageOnBuild. But it still need Publish. So I need to let Pack depend directly on no build version of publish.

> Why cannot directly use “_PublishNoBuildAlternative”?

We want to exclude Build step regardless NoBuild flag is true or not.

> Will it work this time?

It will, since I have GeneratePackageOnBuild + PackAsTool + Publish/Build/Pack all combinations covered in tests. Although I did discover GeneratePackageOnBuild+Pack dotnet#3471 does not work. But it was there since 2.0. And without nuget help, we cannot easily fix it.
@wli3 wli3 closed this as completed Jul 30, 2019
@wli3 wli3 reopened this Aug 27, 2019
@wli3
Copy link
Author

wli3 commented Aug 27, 2019

@wli3 wli3 closed this as completed Aug 27, 2019
dsplaisted pushed a commit to dsplaisted/sdk that referenced this issue Feb 19, 2020
…105.3 (dotnet#3471)

- Microsoft.NET.Sdk.Web - 3.1.100-preview3.19555.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants