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.exe overrides "xmlns" in nuspec incorrectly #2020

Closed
borgdylan opened this issue Jan 31, 2016 · 5 comments
Closed

NuGet.exe overrides "xmlns" in nuspec incorrectly #2020

borgdylan opened this issue Jan 31, 2016 · 5 comments

Comments

@borgdylan
Copy link

Using NuGet.exe 3.4.0 as well as prior versions, I can observe that the XML namespace referenced in the root element of the nuspec file gets overriden incorrecly in the produced package.

DNX as well as the dotnet CLI i.e. dnu pack and dotnet pack set the XML namespace correctly.

I define incorrect as "makes the NuGet XPlat CLI crash while restoring with a strange UTC related exception".

To fix such crashes the xmlns value in the root nuspec element should be <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> instead of <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">. This "correct value" is the same one that is set by both dotnet pack and dnu pack. Do note that dotnet pack will use the NuGet XPlat CLI once it gets pack support. Please make sure that the XML namespace is set OK to avoid these restore bugs.

@borgdylan
Copy link
Author

@emgarten This bug describes that other issue and how to fix it.

@emgarten
Copy link
Member

emgarten commented Feb 1, 2016

nuget falls back to the oldest xsd that can be used for the nuspec. Where is this actually failing? I wouldn't expect the date field from the url to actually be used as a date.

@borgdylan
Copy link
Author

It fails while uncompressing the package leaving just a nuspec file and an oddly named (with a short guid) nupkg file in the installation directory (the one under .nuget/packages in the user profile). The xsd is being overridden on pack but causes bugs on restore i.e. its not immediately obvious that it will cause bugs.

@borgdylan
Copy link
Author

Either way, there is an incompatibility bug between the nuget CLI and NuGet.exe when run on mono with the nuget CLI not supporting the fallback XSD.

@rrelyea
Copy link
Contributor

rrelyea commented Oct 17, 2017

dotnet new classlib
dotnet pack
nuspec created uses:
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">

closing as fixed - likely in dotnet 1.1, nuget 4.0, vs 2017 version 15.0 era - feb 2017.

@rrelyea rrelyea closed this as completed Oct 17, 2017
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

4 participants