Choco: 'choco pack' runs into error message

Created on 17 Apr 2018  路  8Comments  路  Source: chocolatey/choco

What You Are Seeing?

choco pack returns the error message

The element 'metadata' in namespace 'http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd' cannot contain text. List of possible elements expected: 'mailingListUrl, tags, description, title, softwareDisplayVersion, authors, licenseUrl, copyright, provides, replaces, wikiUrl, language, owners, requireLicenseAcceptance, dependencies, iconUrl, softwareDisplayName, projectSourceUrl, references, bugTrackerUrl, developmentDependency, docsUrl, releaseNotes, conflicts, summary, projectUrl, frameworkAssemblies, contentFiles' in namespace 'http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd'.

What is Expected?

choco pack should create a chocolatey package

How Did You Get This To Happen? (Steps to Reproduce)

I have prepared an example under https://github.com/RufusJWB/puTTY-CAC-Chocolatey . The .nuspec-file was created with choco new.

Output Log

https://gist.github.com/RufusJWB/caa7b6aad26cb4a720f8348d71ebbf1a

Invalid / Not Issue / No repro / Not Implementing

Most helpful comment

馃憤 My eyes are trained to spot those kinds of things I guess ;)

All 8 comments

For whatever reasons, after commenting out everything and commenting in line by line, it is now working as expected. No idea why. Maybe someone wants to investigate with the original nuspec file (https://github.com/RufusJWB/puTTY-CAC-Chocolatey/blob/e2262357a42c816df12051a1a9a2dd98ed1709db/puTTY%20CAC/putty%20cac.nuspec) and see if choco has a problem with control characters or something.

It was letting you know that something was wrong, so unless it came out that way when you ran choco new, it's likely just a missed thing after the fact. It would be nice if the error message was better, but I'm unsure if it's something that could tell us exact line or any of that since it's in the NuGet.Core code where this message is generated.

If it produced this when it generated, it is a bug in Chocolatey:

<packageSourceUrl>https://github.com/RufusJWB/puTTY-CAC-Chocolatey</packageSourceUrl>--> (note the --> still there)

However it appears when I run choco new, that entire line is commented on both sides to allow for nuget.exe to pack the package as well.

Nice find. My source code editor didn't complain about wrong XML syntax. Pretty sure the problem was me. Thank you for supporting!

馃憤 My eyes are trained to spot those kinds of things I guess ;)

Thumbs up from me too, I ran into the same thing. Misleading error and didn't spot it

If it produced this when it generated, it is a bug in Chocolatey:

<packageSourceUrl>https://github.com/RufusJWB/puTTY-CAC-Chocolatey</packageSourceUrl>--> (note the --> still there)

However it appears when I run choco new, that entire line is commented on both sides to allow for nuget.exe to pack the package as well.

That was my case as well 馃槃 thanks!

Was this page helpful?
0 / 5 - 0 ratings