Файл .nuspec пакета Nuget. Конвейер Azure не использует свойства сборки csproj. Но тот же проект можно упаковать локально

Ниже показано, что я вижу в задаче Pipeline Nuget Pack.

Я пытаюсь сделать Nuget Pack с использованием **/*.nuspec файлов.

Этот проект можно без проблем упаковать локально с помощью пакета nuget.

По какой-то причине он не выбирает значения свойств в файле сборки csproj

Что В СБОРЕ файл

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("SOMECOMPANY.Mapping")]
[assembly: AssemblyDescription("SOMECOMPANY Mapping")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("SOMECOMPANY")]
[assembly: AssemblyProduct("SOMECOMPANY.Mapping")]
[assembly: AssemblyCopyright("Copyright ©  2018")]
[assembly: AssemblyTrademark("SOMECOMPANY")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("9c3a7a3b-964b-4d85-b543-8bcc55fc6589")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

ЧТО В ТРУБНОЙ ЛИНИИ

##[section]Starting: NuGet pack
==============================================================================
Task         : NuGet
Description  : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Azure Artifacts and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
Version      : 2.156.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/package/nuget
==============================================================================

[command]C:\windows\system32\chcp.com 65001
Active code page: 65001
##[warning]The automatic package versioning and include referenced projects options do not work together. Referenced projects will not inherit the custom version provided by the automatic versioning settings.
Attempting to pack file: d:\a\1\s\src\SOMECOMPANY.Core\SOMECOMPANY.Mapping\SOMECOMPANY.Mapping.nuspec
[command]C:\hostedtoolcache\windows\NuGet\4.1.0\x64\nuget.exe pack d:\a\1\s\src\SOMECOMPANY.Core\SOMECOMPANY.Mapping\SOMECOMPANY.Mapping.nuspec -NonInteractive -OutputDirectory d:\a\1\a -IncludeReferencedProjects -Symbols -version 1.0.0-CI-20190824-170629 -Verbosity Detailed
System.Exception: Id is required.
NuGet Version: 4.1.0.2450
**Authors is required.
Attempting to build package from 'SOMECOMPANY.Mapping.nuspec'.
Description is required.**
   at NuGet.Packaging.Manifest.Validate(Manifest manifest)
   at NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func`2 propertyProvider, Boolean validateSchema)
   at NuGet.Packaging.PackageBuilder.ReadManifest(Stream stream, String basePath, Func`2 propertyProvider)
   at NuGet.Packaging.PackageBuilder..ctor(String path, String basePath, Func`2 propertyProvider, Boolean includeEmptyDirectories)
   at NuGet.Commands.PackCommandRunner.CreatePackageBuilderFromNuspec(String path)
   at NuGet.Commands.PackCommandRunner.BuildFromNuspec(String path)
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

**##[error]The nuget command failed with exit code(1) and error(System.Exception:** **Id is required.
Authors is required.
Description is required.**
   at NuGet.Packaging.Manifest.Validate(Manifest manifest)
   at NuGet.Packaging.Manifest.ReadFrom(Stream stream, Func`2 propertyProvider, Boolean validateSchema)
   at NuGet.Packaging.PackageBuilder.ReadManifest(Stream stream, String basePath, Func`2 propertyProvider)
   at NuGet.Packaging.PackageBuilder..ctor(String path, String basePath, Func`2 propertyProvider, Boolean includeEmptyDirectories)
   at NuGet.Commands.PackCommandRunner.CreatePackageBuilderFromNuspec(String path)
   at NuGet.Commands.PackCommandRunner.BuildFromNuspec(String path)
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args))
##[error]An error occurred while trying to pack the files.
##[section]Finishing: NuGet pack

person AllSpark    schedule 24.08.2019    source источник


Ответы (1)


Решил это. значения сборки не подбираются при упаковке с использованием nuspec. он выбирается только при использовании пакета в файле csproj.

я указал все файлы csproj в паке

MSdn https://docs.microsoft.com/en-us/nuget/reference/nuspec

person AllSpark    schedule 25.08.2019