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

Manifest.ReadFrom fails on any nuspec with LicenseExpression #7894

Closed
ericstj opened this issue Mar 21, 2019 · 0 comments
Closed

Manifest.ReadFrom fails on any nuspec with LicenseExpression #7894

ericstj opened this issue Mar 21, 2019 · 0 comments
Assignees
Milestone

Comments

@ericstj
Copy link

ericstj commented Mar 21, 2019

Please read the following information before posting the issue.

Before posting the issue...

  • If you're having trouble with the NuGet.org Website, please post in NuGetGallery issues
  • If you're having trouble with the NuGet client tools (the Visual Studio extension, NuGet.exe command line tool, etc.), you are in the right place.

Remove the content above here and fill out details below.

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
dotnet.exe

NuGet version (x.x.x.xxx):
4.9.2.0

dotnet.exe --version (if appropriate):
2.2.103

Worked before? If so, with which NuGet version:
nope

Detailed repro steps so we can see the same problem

  1. Generate a nuspec with LicenseExpression and save using Manifest.Save

  2. Load that Nuspec with Manifest.ReadFrom

Expect: success in round-tripping nuspec

Actual:

System.Exception: The licenseUrl and license elements cannot be used together.
at NuGet.Packaging.Manifest.Validate(Manifest manifest) 
at NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func`2 propertyProvider, Boolean validateSchema)

The same can be observed if you try to use Manifest.ReadFrom with any nuspec that's in a dotnet-pack'ed package that used LicenseExpression.

The culprit appears to be a bad equality check here:
https://github.com/NuGet/NuGet.Client/blob/91d2331328d55ab9f450af1fbf184fc1f261ed25/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs#L336-L339

It's calling String.Equals and passing a URI.

dotnet/arcade#2091 (comment) /cc @tmat @nkolev92

ericstj added a commit to ericstj/corefx that referenced this issue Mar 21, 2019
ViktorHofer pushed a commit to dotnet/corefx that referenced this issue Mar 21, 2019
* Manual update to 20190320.3 of arcade

* Disable use of PackageLicenseExpression

We need to workaround NuGet issue NuGet/Home#7894
@nkolev92 nkolev92 added this to the 5.1 milestone Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants