Nuget包装Nuspec:值不能为Null或空字符串。参数名称:值 [英] NuGet Packing a Nuspec: Value cannot be null or empty string. Parameter name: value
本文介绍了Nuget包装Nuspec:值不能为Null或空字符串。参数名称:值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为一个网站打包一堆Java脚本。下面是我的.nuspec
的样子。
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<version>$version$</version>
<authors>Author Person</authors>
<owners>Company Name</owners>
<id>PackageNameId</id>
<title>PackageNameId</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Description text stuff</description>
<copyright>Company Copyright Info</copyright>
</metadata>
<files>
<file src="www**" target="" /> <!--It just packages everything in the www folder in the same directory as this .nuspec -->
</files>
</package>
它只是将所有内容打包到www文件夹中。$version$
标记应替换为TFS(我正在构建的内容)中的NugetPackage版本标志。
我没有看到名为value
的东西,所以我真的不知道它为什么会抛出错误。
以下是完整错误:
Attempting to build package from 'PackageName.nuspec'.
##[error]Value cannot be null or an empty string.
##[error]Parameter name: value
推荐答案
我怀疑您是在nuspec
文件而不是csproj
文件上运行此错误。
nuget pack
时,assblyInfo标记替换(例如<version>$version$</version>
)才起作用。引用自NuGet documentation:
直接使用项目文件是替换令牌所必需的,因为项目是令牌值的来源。如果您将Nuget Pack与.nuspec文件一起使用,则不会发生令牌替换。
这篇关于Nuget包装Nuspec:值不能为Null或空字符串。参数名称:值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文