Nuget Azure Pielines:打包具有依赖项的csproj失败,因为依赖项不符合xsd?

Nuget Azure Pielines:打包具有依赖项的csproj失败,因为依赖项不符合xsd?,nuget,azure-pipelines,nuget-package,azure-pipelines-build-task,nuspec,Nuget,Azure Pipelines,Nuget Package,Azure Pipelines Build Task,Nuspec,我有以下几点 <?xml version="1.0" encoding="utf-8"?> <package> <metadata> <id>$id$</id> <version>$version$</version> <title>$title$</title> <authors>$author$&l

我有以下几点

<?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>

$id$
$version$
$title$
$author$
$author$
假的
$description$
阿尔法释放。
版权所有2021
一些标签
以及以下管道任务定义:

- 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
-任务:NuGetCommand@2
投入:
命令:“打包”
PackageTopack:“$(Build.Repository.LocalPath)\\\.csproj”
版本方案:“关闭”
includeSymbols:true
nugetConfigPath:$(Build.Repository.LocalPath)\\nuget.config
While失败,出现以下错误:

System.InvalidOperationException:命名空间中的元素“组”http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd”“是的 命名空间“处”中的子元素“Depdency”无效 NuGet.Packaging.Manifest.c.b\u 20\u 0(对象 发送方,验证目标(e)位于 System.Xml.Schema.XmlSchemaValidator.ValidateElementContext(XmlQualifiedName elementName、布尔值和InvalidelementContext)位于 System.Xml.Schema.XmlSchemaValidator.ValidateElement(字符串localName, 字符串名称空间URI、XmlSchemaInfo schemaInfo、字符串xsiType、字符串 xsini、字符串xsiSchemaLocation、字符串xsiNoNamespaceSchemaLocation) 位于System.Xml.Schema.XNodeValidator.ValidateElement(XElement e) System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateNodes(XElement e)位于 System.Xml.Schema.XNodeValidator.ValidateElement(XElement e)位于 System.Xml.Schema.XNodeValidator.Validate(XObject源、, XmlSchemaObject partialValidationType,Boolean addSchemaInfo)位于 NuGet.Packaging.Manifest.ValidateManifestSchema(XDocument文档, 字符串schemaNamespace),位于NuGet.Packaging.Manifest.ReadFrom(流 流,Func`2 propertyProvider,布尔值validateSchema)位于 numet.CommandLine.ProjectFactory.ProcessNuspec(PackageBuilder、, 字符串基路径)在 NuGet.CommandLine.ProjectFactory.CreateBuilder(字符串basePath, NuGetVersion版本,字符串后缀,布尔BuildIfRequired, PackageBuilder)位于 NuGet.Commands.PackCommandRunner.BuildFromProjectFile(字符串路径)
在numget.CommandLine.PackCommand.ExecuteCommand()处 位于的numget.CommandLine.Command.ExecuteCommandAsync()命令 numget.CommandLine.Command.Execute()位于 NuGet.CommandLine.Program.MainCore(字符串工作目录,字符串[]) args)

生成日志为:

NuGet版本:5.8.0.6930正在尝试从“.csproj”生成包。MSBuild自动检测:使用MSBuild版本 来自“C:\Program Files(x86)\Microsoft Visual”的“16.9.0.16703” Studio\2019\Enterprise\MSBuild\Current\bin'。使用选项 -MSBuildVersion强制nuget使用特定版本的MSBuild。正在打包来自“D:\a\1\s\bin\Debug\netstandard2.0”的文件。对元数据使用“.nuspec”

我真的很困惑为什么它要使用这么旧的xsd,我可以在本地构建这个解决方案,在本地打包,在本地推送,然后从私有提要上很好地读取它。。。但当我尝试使用管道将其自动化时,它就是不喜欢我的依赖项节点。关于我做错了什么有什么线索吗?

我是个白痴

在我在这里发布的版本中,我删除了一个依赖节点项以使其更易于阅读,但是第二个依赖节点拼写为“dependency”,所以这完全是愚蠢的。将其重命名为“dependency”修复了该问题


真希望解析器会这么说,而不是告诉我我的xsd是错的。我想它对我的信心比它应该的要大。

你试过把
改成
吗?是的,很不幸……我只是再试了一次,但还是失败了,同样的错误很不幸。我确实注意到那些官方的xsd链接哪儿也去不了(404),当我尝试我的xsd时,我确实得到了一个新的错误##[错误]nuget命令失败,退出代码为(1),出现错误(“项目名称”的架构版本与nuget的5.8.0.6930版本不兼容。请从升级到最新版本。