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

dotnet pack mistakenly uses alias for WPF Library projects #10020

Closed
zkat opened this issue Sep 10, 2020 · 0 comments · Fixed by NuGet/NuGet.Client#3678
Closed

dotnet pack mistakenly uses alias for WPF Library projects #10020

zkat opened this issue Sep 10, 2020 · 0 comments · Fixed by NuGet/NuGet.Client#3678

Comments

@zkat
Copy link
Contributor

zkat commented Sep 10, 2020

When packing a project with a target platform, when the target platform version is not included in the .csproj (but a platform is), the lib files are pulled in using the "alias".

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): All of the above

dotnet.exe --version (if appropriate): 5.0.100-rc.1.20454.5

VS version (if appropriate): 16.8.4-pre.4.0

OS version (i.e. win10 v1607 (14393.321)): win10

Worked before? If so, with which NuGet version: no

Detailed repro steps so we can see the same problem

  1. mkdir nuget-repro && cd nuget-repro && dotnet new wpflib
  2. dotnet pack
  3. look in the .nupkg lib directory

Result

We get a facefull of warnings:

❯ dotnet pack
Microsoft (R) Build Engine version 16.8.0-preview-20451-02+51a1071f8 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  bar -> C:\Users\kmarchan\src\bar\bin\Debug\net5.0-windows\bar.dll
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20454.5\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): warning NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below: [C:\Users\kmarchan\src\bar\bar.csproj]
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20454.5\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): warning NU5128: - Add a dependency group for net5.0-windows to the nuspec [C:\Users\kmarchan\src\bar\bar.csproj]
C:\Program Files\dotnet\sdk\5.0.100-rc.1.20454.5\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(198,5): warning NU5128: - Add lib or ref assemblies for the net5.0-windows7.0 target framework [C:\Users\kmarchan\src\bar\bar.csproj]
  Successfully created package 'C:\Users\kmarchan\src\bar\bin\Debug\bar.1.0.0.nupkg'.

...and it's using net5.0-windows instead of net5.0-windows7.0.

@zkat zkat added this to the Sprint 176 - 2020.09.07 milestone Sep 10, 2020
@zkat zkat self-assigned this Sep 10, 2020
@aortiz-msft aortiz-msft changed the title Alias being used in pack for lib files Dotnet Pack mistakenly uses alias for WPF Library projects Sep 16, 2020
zkat added a commit to NuGet/NuGet.Client that referenced this issue Sep 24, 2020
aortiz-msft pushed a commit to NuGet/NuGet.Client that referenced this issue Sep 24, 2020
* translate aliases for lib and contentFiles

Fixes: NuGet/Home#10020

* quick test for the lib part
zkat added a commit to NuGet/NuGet.Client that referenced this issue Sep 24, 2020
* translate aliases for lib and contentFiles

Fixes: NuGet/Home#10020

* quick test for the lib part
zkat added a commit to NuGet/NuGet.Client that referenced this issue Sep 29, 2020
@dominoFire dominoFire changed the title Dotnet Pack mistakenly uses alias for WPF Library projects dotnet pack mistakenly uses alias for WPF Library projects Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants