You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error while parsing <dependency id="Newtonsoft.Json" version="*" /> #2266
Paket failed with:
Cannot load C:\Users\CameronTaggart\tachyus\thermion\packages\JWT\JWT.nuspec
Message: Error while parsing *
Message: Can't parse "*".
Input string was not in a correct format.
<?xml version="1.0" encoding="utf-8"?>
<packagexmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>JWT</id>
<version>2.3.1</version>
<authors>John Sheehan, Michael Lehenbauer, Alexander Batishchev</authors>
<owners>johnsheehan, devinrader, abatishchev</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<licenseUrl>https://creativecommons.org/publicdomain/zero/1.0/</licenseUrl>
<projectUrl>https://github.com/jwt-dotnet/jwt</projectUrl>
<description>Jwt.Net, a JWT (JSON Web Token) implementation for .NET</description>
<copyright>Public Domain</copyright>
<language>en-US</language>
<tags>jwt json</tags>
<dependencies>
<dependencyid="Newtonsoft.Json"version="*" />
</dependencies>
</metadata>
</package>
Repro steps
Please provide the steps required to reproduce the problem
nuget JWT 2.3.1
If possible then please create a git repository with a repro sample or attach a zip to the issue.
Expected behavior
I'm not sure if this is a nuspec authoring error or a paket error.
Reading the nuspec/nuget/dotnet docs, I can't find any references to using a wildcard without preceding numbers.
Also, JWT v2.3.1 seems to be no longer available on NuGet, and the next version 2.3.2 does have a version specified for the dependency.
However, all previous beta and alpha versions - from 2.0.0-beta2 up to 2.3.0-beta - still have the bogus dependency, which means Nuget.org does technically allow it.
In version 2.0.0-beta2, where the offending nuspec line first appeared, it had no "version" attribute at all, rather than an asterisk. This means that the asterisk was added during packing. Considering the lack of documentation for this "feature", I'm inclined to think that this is just a bug in Nuget.
Parsing * as >=0 is inconsistent with dotnet restore. When the spec is ">= 0", Paket will select the highest version, but dotnet restore will select the lowest (I have verified this empirically, just in case). This will cause different resolution of Newtonsoft.Json (and thus potentially different behavior) between Paket-based apps that reference JWT v2.3.0-beta and similar apps that do not use Paket. Is that ok?
Paket had always been different in install behavior. I could write endless essays about that. When we do convert we try to do a conservative conversion and keep it as aligned as possible to nuget. But sometimes that's not really possible.
Activity
forki commentedon Apr 20, 2017
I think they changed something to allow this nightmare. A fix is underway - but will take some time since I want to run all integration tests
forki commentedon Apr 20, 2017
NOTE: Someone should do it properly - I just fixed the error. but it seems nuget ranges are now changed and our parser needs adjustments
forki commentedon Apr 20, 2017
also related: 1575266
forki commentedon Apr 20, 2017
reopened in order to let someone else fix it properly. but paket 4.5.1 release build is running and reported error will be fixed
forki commentedon Apr 20, 2017
ok fix is released.
fsoikin commentedon Jul 2, 2017
Reading the nuspec/nuget/dotnet docs, I can't find any references to using a wildcard without preceding numbers.
Also, JWT v2.3.1 seems to be no longer available on NuGet, and the next version 2.3.2 does have a version specified for the dependency.
However, all previous beta and alpha versions - from 2.0.0-beta2 up to 2.3.0-beta - still have the bogus dependency, which means Nuget.org does technically allow it.
In version 2.0.0-beta2, where the offending nuspec line first appeared, it had no "version" attribute at all, rather than an asterisk. This means that the asterisk was added during packing. Considering the lack of documentation for this "feature", I'm inclined to think that this is just a bug in Nuget.
forki commentedon Jul 2, 2017
I think * should be parsed as >= 0
fsoikin commentedon Jul 3, 2017
@forki:
But your fix in 3b8047e already does that, no?
Parsing * as >=0 is inconsistent with
dotnet restore. When the spec is ">= 0", Paket will select the highest version, butdotnet restorewill select the lowest (I have verified this empirically, just in case). This will cause different resolution ofNewtonsoft.Json(and thus potentially different behavior) between Paket-based apps that referenceJWTv2.3.0-beta and similar apps that do not use Paket. Is that ok?forki commentedon Jul 3, 2017
Paket had always been different in install behavior. I could write endless essays about that. When we do convert we try to do a conservative conversion and keep it as aligned as possible to nuget. But sometimes that's not really possible.
fsoikin commentedon Jul 3, 2017
Ok, I suspected that would be the answer.
But what about the first point? Didn't your commit already make it parse as ">= 0"? Should this case be closed then?
forki commentedon Jul 3, 2017
yes I think I did that