Repository navigation
Closed
NuGet/NuGet.Client
#3226Labels
Area:ErrorHandlingwarnings and errors/log messages & related error codes.Category:Quality WeekIssues that should be considered for quality weekFunctionality:PackType:DCRDesign Change Request
Milestone
Description
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.
Reacted by Martin Andreas Ullrich and ʃʈɑɲ
Metadata
Metadata
Assignees
Labels
Area:ErrorHandlingwarnings and errors/log messages & related error codes.Category:Quality WeekIssues that should be considered for quality weekFunctionality:PackType:DCRDesign Change Request
Activity
emgarten commentedon May 9, 2017
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.
joelverhagen commentedon May 9, 2017
Sounds reasonable. As long as the story is consistent, LGTM.
[-]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[/+]alx9r commentedon Jul 26, 2017
FWIW this warning just saved me a bunch of investigation work:
In particular, Visual Studio 2015 14.0.25431.01 Update 3 doesn't seem to see packages with numeric pre-release suffixes (see #5654).
NickCraver commentedon Feb 11, 2018
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.rohit21agrawal commentedon Feb 11, 2018
@NickCraver this work is almost done. Track it @ NuGet/NuGet.Client#2013
NickCraver commentedon Feb 11, 2018
@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.
rohit21agrawal commentedon Feb 11, 2018
Every warning will have an assigned cod, and you will be able to turn each warning on/off
NickCraver commentedon Feb 11, 2018
@rohit21agrawal awesome news, thank you!
gojanpaolo commentedon Dec 20, 2019
Hello, how do we turn a specific warning off? we're using nuget pack and a nuspec file.
nkolev92 commentedon Feb 5, 2020
I think we should disable this warning, I'll make the change.
nkolev92 commentedon Feb 5, 2020
@gojanpaolo
The code is NU5105, so you can use:
Related: https://github.com/NuGet/docs.microsoft.com-nuget/issues/1457
gojanpaolo commentedon Feb 5, 2020
Awesome! Thank you!