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

NuGet package "Part URI cannot start with two forward slashes." error #40

Open
5 tasks done
whyleee opened this issue Dec 13, 2023 · 9 comments
Open
5 tasks done
Assignees
Labels
bug Something isn't working

Comments

@whyleee
Copy link

whyleee commented Dec 13, 2023

Bug Report

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version of AngleSharp?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)
  • Did you perform a search in the issues?

For more information, see the CONTRIBUTING guide.

Description

We get a NuGet error when pushing latest "anglesharp.diffing.0.18.2.nupkg" package to our private NuGet feed in AppVeyor:

NuGet package cannot be read: Part URI cannot start with two forward slashes.

I found exactly same issue with another package: dotnet/aspnet-api-versioning#637.

[Content_Types].xml file in "anglesharp.diffing.0.18.2.nupkg" package has the same problem with LICENSE file:

<?xml version="1.0" encoding="utf-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
  <Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
  <Default Extension="dll" ContentType="application/octet" />
  <Default Extension="xml" ContentType="application/octet" />
  <Default Extension="png" ContentType="application/octet" />
  <Default Extension="nuspec" ContentType="application/octet" />
  <Override PartName="//LICENSE" ContentType="application/octet" />
</Types>

Looking into another AngleSharp package "anglesharp.css.0.17.0" (also latest version) [Content_Types].xml file contents doesn't reveal this issue:

<?xml version="1.0" encoding="utf-8"?>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
  <Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
  <Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
  <Default Extension="dll" ContentType="application/octet" />
  <Default Extension="png" ContentType="application/octet" />
  <Default Extension="xml" ContentType="application/octet" />
  <Default Extension="md" ContentType="application/octet" />
  <Default Extension="nuspec" ContentType="application/octet" />
</Types>

Could you please fix NuGet package build, so it produces the valid metadata?

Steps to Reproduce

We use AppVeyor NuGet Push-AppveyorArtifact helper to push NuGet packages to the private feed (https://www.appveyor.com/docs/packaging-artifacts/#pushing-artifacts-from-scripts):

Push-AppveyorArtifact anglesharp.diffing.0.18.2.nupkg

More simple way to test:

  1. Extract "anglesharp.diffing.0.18.2.nupkg" as a zip file into a folder
  2. Open [Content_Types].xml file in the extracted folder

Expected behavior: no <Override PartName="//LICENSE" ContentType="application/octet" /> element.

Actual behavior: <Override PartName="//LICENSE" ContentType="application/octet" /> is present and breaks NuGet push.

Environment details: reproduced at least in current AppVeyor environment that pushes NuGet packages with Push-AppveyorArtifact PowerShell cmdlet.

Possible Solution

AngleSharp and AngleSharp.Css NuGet packages are ok - it seems AngleSharp.Diffing build script could be aligned with those projects to fix the issue.

@whyleee whyleee added the bug Something isn't working label Dec 13, 2023
@egil
Copy link
Collaborator

egil commented Dec 13, 2023

@FlorianRappl does this ring a bell for you?

@FlorianRappl
Copy link
Contributor

No - it also seems to be exclusive to AngleSharp.Diffing.

If standard publish to NuGet.org works then I wonder if the issue might actually be with the NuGet feed of AppVeyor? Why open the bug here?

@whyleee
Copy link
Author

whyleee commented Dec 13, 2023

The issue seems to be with older NuGet tools which are most probably upgraded in NuGet.org.
The similar dotnet/aspnet-api-versioning#637 issue also mentioned NuGet Package Explorer didn't work at the time, although the latest version works for me.

//LICENSE inclusion in [Content_Types].xml looks like an error in NuGet package that may be tolerated by some NuGet tools.

I see AngleSharp and AngleSharp.Css NuGet packages doesn't include LICENSE file, but AngleSharp.Diffing includes it. Does it makes sense to exclude this LICENSE file? This will align this package with others and fix support for older NuGet tools.

@FlorianRappl
Copy link
Contributor

Yeah I think that should be possible - but its up to @egil (the other projects still refer to the license via the URL etc.).

Also maybe it makes sense now to release a 1.0 with a reference to AngleSharp 1.0 and the AngleSharp.Css 1.0 preview package?

@egil
Copy link
Collaborator

egil commented Dec 13, 2023

Yeah I think that should be possible - but its up to @egil (the other projects still refer to the license via the URL etc.).

I have no preference here. Think you set up the deployment and build stuff here too, so I'm happy to be in sync with what the other anglesharp libs are doing.

Also maybe it makes sense now to release a 1.0 with a reference to AngleSharp 1.0 and the AngleSharp.Css 1.0 preview package?

Is it allow to release a none preview package that depends on a preview package? Or is it just frowned upon?

If we are allowed to do so, then it's fine with me.

@FlorianRappl
Copy link
Contributor

If we are allowed to do so, then it's fine with me.

You mean technically allowed? I think it is - it should be. We can just try.

@egil
Copy link
Collaborator

egil commented Dec 14, 2023

Let's try.

Can you help sync the build stuff to this repo. I have not used this setup before.

@FlorianRappl
Copy link
Contributor

Yeah but not this week. I have time for this next week.

I'll take care of it - let's assign me here.

@FlorianRappl FlorianRappl self-assigned this Dec 14, 2023
@egil
Copy link
Collaborator

egil commented Dec 14, 2023

Thank you Florian, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants