Skip to content

nuget.exe pack should no longer warn about packing a SemVer 2.0.0 package #5201

Closed
NuGet/NuGet.Client
#3226

Description

@joelverhagen

Consider this nuspec:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
    <metadata>
        <id>jver.bugbash.dependency</id>
        <version>1.0.0-b1</version>
        <authors>jver</authors>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>My package description.</description>
        <dependencies>
            <dependency id="Newtonsoft.Json" version="1.0.0-alpha.1" />
        </dependencies>
    </metadata>
</package>

Command: nuget.exe pack jver.bugbash.dependency.nuspec

Attempting to build package from 'jver.bugbash.dependency.nuspec'.
Successfully created package 'C:\Users\jver\Desktop\packages\jver.bugbash.dependency.1.0.0\jver.bugbash.dependency.1.0.0-b1.nupkg'.

This is a SemVer 2.0.0 package because the dependency version range has a dot in it, i.e. 1.0.0-alpha.1.

However nuget.exe pack does not warn about this SemVer 2.0.0-ness like it does when the package version itself has a dot.

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
    <metadata>
        <id>jver.bugbash.dependency</id>
        <version>1.0.0-b.1</version>
        <authors>jver</authors>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>My package description.</description>
    </metadata>
</package>

Command: nuget.exe pack jver.bugbash.dependency.nuspec

Attempting to build package from 'jver.bugbash.dependency.nuspec'.
Successfully created package 'C:\Users\jver\Desktop\packages\jver.bugbash.dependency.1.0.0\jver.bugbash.dependency.1.0.0-b.1.nupkg'.
WARNING: Issue found with package 'jver.bugbash.dependency'.

WARNING: Issue: Package version not supported on legacy clients.
WARNING: Description: The package version '1.0.0-b.1' uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients. This message can be ignored if the package is not intended for older clients.
WARNING: Solution: Change the package version to a SemVer 1.0.0 string. If the version contains a release label it must start with a letter.

Activity

  1. emgarten commented on May 9, 2017

    @emgarten
    Member

    The analysis should check the ranges. We should also get rid of this check and warning completely, I think it was originally decided that it would go away when nuget.org supported semver2.

    It isn't bad to be aware of the down level issues, but there have been several complaints from users who don't want to see this warning.

  2. joelverhagen commented on May 9, 2017

    @joelverhagen
    MemberAuthor

    Sounds reasonable. As long as the story is consistent, LGTM.

  3. changed the title [-]nuget.exe pack should warn about SemVer 2.0.0 dependency versions[/-] [+]nuget.exe pack should no longer warn about packing a SemVer 2.0.0 package[/+] on May 9, 2017
  4. alx9r commented on Jul 26, 2017

    @alx9r

    FWIW this warning just saved me a bunch of investigation work:

    WARNING: Description: The package version '0.1.0-123456' uses SemVer 2.0.0 or components of SemVer 1.0.0 that are not supported on legacy clients. This message can be ignored if the package is not intended for older clients.

    In particular, Visual Studio 2015 14.0.25431.01 Update 3 doesn't seem to see packages with numeric pre-release suffixes (see #5654).

  5. added this to the Backlog milestone on Oct 18, 2017
  6. NickCraver commented on Feb 11, 2018

    @NickCraver

    Just chiming in: I'm hitting this now as well and would very much like a way to turn only this warning off (short of /p:NoPackageAnalysis=true) or just remove it for everyone.

  7. rohit21agrawal commented on Feb 11, 2018

    @rohit21agrawal
    Contributor

    @NickCraver this work is almost done. Track it @ NuGet/NuGet.Client#2013

  8. NickCraver commented on Feb 11, 2018

    @NickCraver

    @rohit21agrawal I'm confused by that PR - is that allowing me to ignore this warning, or just all warnings? I see that LegacyVersionWarning is still intact there as a warning itself. Several issues note intent to remove this, but I'm confused on what the plans and options are here.

  9. rohit21agrawal commented on Feb 11, 2018

    @rohit21agrawal
    Contributor

    Every warning will have an assigned cod, and you will be able to turn each warning on/off

  10. NickCraver commented on Feb 11, 2018

    @NickCraver

    @rohit21agrawal awesome news, thank you!

  11. gojanpaolo commented on Dec 20, 2019

    @gojanpaolo

    Every warning will have an assigned cod, and you will be able to turn each warning on/off

    Hello, how do we turn a specific warning off? we're using nuget pack and a nuspec file.

  12. added
    Area:ErrorHandling
    on Feb 5, 2020
  13. nkolev92 commented on Feb 5, 2020

    @nkolev92
    Member

    I think we should disable this warning, I'll make the change.

  14. nkolev92 commented on Feb 5, 2020

    @nkolev92
    Member

    @gojanpaolo

    The code is NU5105, so you can use:

    nuget.exe pack package.nuspec -Properties NoWarn=NU5105

    Related: https://github.com/NuGet/docs.microsoft.com-nuget/issues/1457

  15. gojanpaolo commented on Feb 5, 2020

    @gojanpaolo

    Awesome! Thank you!

  16. added
    Type:DCR
    Category:Quality Week
    on Feb 6, 2020
  17. reopened this on Mar 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area:ErrorHandlingCategory:Quality WeekFunctionality:PackType:DCR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions