Home: nuget.exe pack should no longer warn about packing a SemVer 2.0.0 package

Created on 9 May 2017  路  12Comments  路  Source: NuGet/Home

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.
ErrorHandling Quality Week Pack DCR

Most helpful comment

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.

All 12 comments

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.

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

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).

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.

@NickCraver this work is almost done. Track it @ https://github.com/NuGet/NuGet.Client/pull/2013

@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.

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

@rohit21agrawal awesome news, thank you!

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.

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

@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

Awesome! Thank you!

Was this page helpful?
0 / 5 - 0 ratings