Nuget.exe 包警告:未指定说明.使用“描述" [英] Nuget.exe pack WARNING: Description was not specified. Using 'Description'

查看:43
本文介绍了Nuget.exe 包警告:未指定说明.使用“描述"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过命令行创建 NuGet 包,但我似乎无法弄清楚如何设置描述、作者、标题、摘要、发布说明和所有者.包创建成功它只是给我这个警告:

I'm trying to create a NuGet Package via command line and I can't seem to figure out how to set Description, Author, Title, Summary, releaseNotes, and Owner. The package creates successfully it just gives me this warning:

WARNING: Description was not specified. Using 'Description'.
WARNING: Author was not specified. Using 'User'.

这是我的命令:

NuGet.exe pack "<MyProjectPath>.csproj" -OutputDirectory "<MyOutputDirectory>" -Properties Configuration=release;Description="MyDescription";Authors="MeMeMe...MeToo";Title="MyTitle";Summary="MySummary";releaseNotes="MyChanges;"Owners="MyCompany"

我不确定这是否重要,但我使用的是从 Visual Studio Team Services 下载的CredentialProviderBundle.zip"文件中的 NuGet.exe.

I'm not sure if this matters but I'm using the NuGet.exe that came from the "CredentialProviderBundle.zip" file downloaded from Visual Studio Team Services.

推荐答案

这个命令实际上几乎没有问题.

There's actually almost nothing wrong with the command.

如果没有一些先决条件,就不可能完成问题的要求.

It is not possible to do what the question asks without some prerequisites.

  1. 在与 *.csproj 相同的目录中必须有一个完全相同的 *.nuspec 文件.
  2. *.nuspec 文件必须包含您尝试通过命令行设置的所有元素
  3. 将通过命令行填充的所有元素都必须包含$tokenName$"形式的标记
  4. 在命令行中,您不能指定 *.nuspec 元素名称,而是指定包含在美元符号之间的值(也称为令牌名称)
  5. 标记名称可能与问题中列出的所有属性的元素名称相同,但描述元素除外.Description 元素的标记不得命名为Description".Desc"在这里工作得很好.(这就是为什么我说问题中列出的命令几乎没有错)

以下是此特定示例的 *.nuspec 文件示例:

Here's an example of a *.nuspec file for this specific example:

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
    <metadata>
        <id>$Id$</id>
        <version>$Version$</version>
        <title>$Title$</title>
        <authors>$Authors$</authors>
        <owners>$Owners$</owners>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>$Desc$</description>
        <summary>$Summary$</summary>
        <releaseNotes>$ReleaseNotes$</releaseNotes>
        <copyright>Copyright ©  2016</copyright>
        <dependencies />
    </metadata>
</package>

Id 和 Version 不需要有令牌,因为无论哪种方式它们都会被自动覆盖,但不会有什么坏处.

The Id and Version don't need to have tokens because they will automatically be overwritten either way, but it doesn't hurt.

这是您应该与上面指定的 *.nuspec 文件一起使用的命令行:

Here's the command line you should use with the *.nuspec file as specified above:

NuGet.exe pack "<MyProjectPath>.csproj" -OutputDirectory "<MyOutputDirectory>" -Properties Configuration=release;Desc="MyDescription";Authors="MeMeMe...MeToo";Title="MyTitle";Summary="MySummary";ReleaseNotes="MyChanges;"Owners="MyCompany"

这篇关于Nuget.exe 包警告:未指定说明.使用“描述"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆