I have the following .nuspec
<?xml version="1.0" encoding="utf-8"?><package><metadata><id>$id$</id><version>$version$</version><title>$title$</title><authors>$author$</authors><owners>$author$</owners><requireLicenseAcceptance>false</requireLicenseAcceptance><description>$description$</description><releaseNotes>Alpha release.</releaseNotes><copyright>Copyright 2021</copyright><tags>Some tag</tags><dependencies><group targetFramework="netstandard2.0"><dependency id="Microsoft.Extensions.Logging" version="3.1.15" /></group></dependencies></metadata></package>
And the following pipeline task definition:
- task: NuGetCommand@2 inputs: command: 'pack' packagesToPack: '$(Build.Repository.LocalPath)\<project Folder>\<project name>.csproj' versioningScheme: 'off' includeSymbols: true nugetConfigPath: $(Build.Repository.LocalPath)\<project Folder>\nuget.config
While fails with the following error:
System.InvalidOperationException: The element 'group' in namespace 'http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd' hasinvalid child element 'depdenency' in namespace ' atNuGet.Packaging.Manifest.<>c.b__20_0(Objectsender, ValidationEventArgs e) atSystem.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedNameelementName, Boolean& invalidElementInContext) atSystem.Xml.Schema.XmlSchemaValidator.ValidateElement(String localName,String namespaceUri, XmlSchemaInfo schemaInfo, String xsiType, StringxsiNil, String xsiSchemaLocation, String xsiNoNamespaceSchemaLocation)at System.Xml.Schema.XNodeValidator.ValidateElement(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateNodes(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateElement(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateNodes(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateElement(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateNodes(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateElement(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateNodes(XElement e) atSystem.Xml.Schema.XNodeValidator.ValidateElement(XElement e) atSystem.Xml.Schema.XNodeValidator.Validate(XObject source,XmlSchemaObject partialValidationType, Boolean addSchemaInfo) atNuGet.Packaging.Manifest.ValidateManifestSchema(XDocument document,String schemaNamespace) at NuGet.Packaging.Manifest.ReadFrom(Streamstream, Func`2 propertyProvider, Boolean validateSchema) atNuGet.CommandLine.ProjectFactory.ProcessNuspec(PackageBuilder builder,String basePath) atNuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath,NuGetVersion version, String suffix, Boolean buildIfNeeded,PackageBuilder builder) atNuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand() atNuGet.CommandLine.Command.ExecuteCommandAsync() atNuGet.CommandLine.Command.Execute() atNuGet.CommandLine.Program.MainCore(String workingDirectory, String[]args))
The build log is:
NuGet Version: 5.8.0.6930 Attempting to build package from '.csproj'. MSBuild auto-detection: using msbuild version'16.9.0.16703' from 'C:\Program Files (x86)\Microsoft VisualStudio\2019\Enterprise\MSBuild\Current\bin'. Use option-MSBuildVersion to force nuget to use a specific version of MSBuild. Packing files from 'D:\a\1\s<projectfolder>\bin\Debug\netstandard2.0'. Using '.nuspec' for metadata.
I am really stumped why it's using such an old xsd, and I can build this solution locally, pack it locally, and push it locally, and then read it from the private feed just fine... but when I try to automate it with a pipeline, it just does not like my dependencies node. Any clue as to what I'm doing wrong?