Nuget:"The replacement token 'id' has no value"



执行

nuget.exe pack ...nugetnuget.exe pack ..pathToProjectmyproject.nuspec -IncludeReferencedProjects -Prop Configuration=Release

我得到错误

The replacement token 'id' has no value.

nuspec看起来像这个

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
    <metadata>
        <id>$id$</id>
        <version>$version$</version>
        <title>$id$</title>
        <authors>$author$</authors>
        <requireLicenseAcceptance>false</requireLicenseAcceptance>
        <description>$description$</description>
    </metadata>
</package>

使用令牌替换时,请确保您正在尝试nuget打包csproj文件,而不是nuspec的文件

nuget pack myproject.csproj -IncludeReferencedProjects -Prop Configuration=Release

当被赋予与csproj文件相同的名称时,nuspec会自动拾取。

相关内容

最新更新