Azure饼图:由于依赖项不符合xsd,用依赖项打包csproj失败



我有以下.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>

以及以下流水线任务定义:

- 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

失败时出现以下错误:

System.InvalidOperationException:命名空间"中的元素"group"http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd'已位于的命名空间"中的子元素"depdency"无效NuGet.包装.清单。<gt;c.b__20_0(对象发件人,ValidationEventArgs e(System.Xml.Schema.XmlSchemaValidator.ValideElementContext(XmlQualifiedNameelementName,布尔型&invalidElementInContext(System.Xml.Schema.XmlSchemaValidator.ValideElement(字符串localName,字符串namespaceUri,XmlSchemaInfo schemaInfo,字符串xsiType,字符串xsiNil、字符串xsiSchemaLocation、字符串xsiNoNamespaceSchemaLocation(位于的System.Xml.Schema.XNodeValidator.ValideElement(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideNodes(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideElement(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideNodes(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideElement(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideNodes(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideElement(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideNodes(XElement e(位于的System.Xml.Schema.XNodeValidator.ValideElement(XElement e(System.Xml.Schema.XNodeValidator.Valide(XObject-source,XmlSchemaObject partialValidationType,Boolean addSchemaInfo(NuGet.Packaging.Manifest.ValidateManifestSchema(XDocument文档,字符串schemaNamespace(在NuGet.Packaging.Manifest.ReadFrom(Stream流,Func`2属性提供者,布尔validateSchema(NuGet.CommandLine.ProjectFactory.ProcessNuspec(PackageBuilder生成器,字符串basePath(NuGet.CommandLine.ProjectFactory.CreateBuilder(基于字符串的路径,NuGetVersion版本,字符串后缀,Boolean buildIfNeeded,PackageBuilder生成器(NuGet.Commands.PackCommandRunner.BuildFromProjectFile(字符串路径(
位于位于的NuGet.CommandLine.Command.ExecuteCommandAsync((位于的NuGet.CommandLine.Command.Execute((NuGet.CommandLine.Program.MainCore(字符串工作目录,String[]args((

构建日志为:

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

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

我是个白痴!

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

真希望解析器能这么说,而不是告诉我xsd错了。我想它对我的信任超过了应有的程度。

最新更新