当我在命令行中运行 nuget pack MyProject.csproj
后,我遇到了以下错误:
替换标记 'author' 没有值。
我检查了我的 AssemblyInfo 文件,其中 AssemblyCompany 被指定为 "AJ Richardson"。我尝试手动将 nuspec 文件中的 $author$
替换为 AJ Richardson
,但是然后遇到了一个略微不同的错误:
替换标记 'description' 没有值。
但是 AssemblyDescription
也已经被指定了。似乎 NuGet 没有从我的 AssemblyInfo
中读取任何内容。我已经验证了 AssemblyInfo
被包含在我的项目中,并且构建操作已设置为编译。
我之前创建过几个 NuGet 包,没有遇到任何问题。这个包与我的先前的包唯一的区别是它有依赖项。
以下是我的 nuspec 的参考:
<?xml version="1.0"?>
<package>
<metadata>
<id>$id$</id>
<version>1.0.0</version>
<title>$title$</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>https://github.com/my/repo/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/my/repo</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>Initial release.</releaseNotes>
<copyright>Copyright AJ Richardson 2015</copyright>
<tags></tags>
</metadata>
<dependencies>
<dependency id="Newtonsoft.Json" version="6.0.1" />
</dependencies>
</package>
所以我的问题是,为什么NuGet没有读取我的AssemblyInfo,我该如何说服它这样做?
所以我的问题是,为什么 NuGet 没有读取我的 AssemblyInfo
,我该如何说服它这样做?