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

Packaging of 'net5.0-windows' broken since 5.9.1.11 #10853

Closed
GeertvanHorrik opened this issue May 11, 2021 · 2 comments
Closed

Packaging of 'net5.0-windows' broken since 5.9.1.11 #10853

GeertvanHorrik opened this issue May 11, 2021 · 2 comments
Labels
Functionality:Pack Product:NuGet.exe NuGet.exe Resolution:NotABug This issue appears to not be a bug

Comments

@GeertvanHorrik
Copy link

Details about Problem

NuGet product used (NuGet.exe | Visual Studio | MSBuild.exe | dotnet.exe): NuGet.exe

Product version:

Worked before? If so, with which NuGet version:

Worked: 5.8.1
Not working: 5.9.1.11

Repro steps and/or sample project

We want to package a NuGet package with only "net5.0-windows". We need this to support our Squirrel installations and updates.

Before 5.9, we could create a package for a project targeting net5.0-windows. After the update, we no longer can package because of this error:

NU1012: Some included files are included under TFMs which are missing a platform version: net5.0-windows
NuGet.Packaging.Core.PackagingException: Some included files are included under TFMs which are missing a platform version: net5.0-windows
   at NuGet.Packaging.PackageBuilder.ValidateFileFrameworks(IEnumerable`1 files)
   at NuGet.Packaging.PackageBuilder.Save(Stream stream)
   at NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder builder, String outputPath, Boolean symbolsPackage)
   at NuGet.Commands.PackCommandRunner.BuildFromNuspec(String path)
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

Our potential workarounds are:

  1. Don't update NuGet to 5.9
  2. Explicitly set net5.0-windows7.0 as target framework (but why enforce this, it should fallback to this by default?)

Verbose Logs

GeertvanHorrik added a commit to GeertvanHorrik/RepositoryTemplate that referenced this issue May 11, 2021
@erdembayar
Copy link
Contributor

erdembayar commented May 11, 2021

@GeertvanHorrik
Thank you for filing this issue.
I believe that change was part of wider .net 5 sdk change. If you looks at .net 5 sdk design then you'll see net5.0-windowsX.Y as target framework, and X.Y as TPV(TargetPlatformVersion).
@zkat Could be able to add more details here?

Edit: If you're not going to pack via csproj, then you'll need to append the platform version number yourself as mentioned here.

@erdembayar erdembayar added the Resolution:NotABug This issue appears to not be a bug label May 11, 2021
@nkolev92
Copy link
Member

This is by design.
The net5.0-platform style target frameworks must have a target platform version.

Change here; NuGet/NuGet.Client#3691

azeno added a commit to stride3d/stride that referenced this issue Jul 2, 2021
- Apparently the TFM net5.0-windows must be net5.0-windows7.0 (see NuGet/Home#10853)
- MSBuild Locator needed an update - `projectCollection.LoadProject` was complaining that it couldn't find the Microsoft.NET.Sdk
- The C++ projects were building against net4 instead of net472 for some unkown reason leading to complaints that net4 can't target netstandard2 etc. - adding a check fixed that
xen2 pushed a commit to stride3d/stride that referenced this issue Jul 12, 2021
- Apparently the TFM net5.0-windows must be net5.0-windows7.0 (see NuGet/Home#10853)
- MSBuild Locator needed an update - `projectCollection.LoadProject` was complaining that it couldn't find the Microsoft.NET.Sdk
- The C++ projects were building against net4 instead of net472 for some unkown reason leading to complaints that net4 can't target netstandard2 etc. - adding a check fixed that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Pack Product:NuGet.exe NuGet.exe Resolution:NotABug This issue appears to not be a bug
Projects
None yet
Development

No branches or pull requests

3 participants