nuget:“替换令牌‘id’没有价值"; [英] nuget: "The replacement token 'id' has no value"

查看:51
本文介绍了nuget:“替换令牌‘id’没有价值";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行

nuget.exe pack ..\.nuget\nuget.exe pack ..\pathToProject\myproject.nuspec -IncludeReferencedProjects -Prop Configuration=Release

我收到错误

The replacement token 'id' has no value.

nuspec 看起来像这样

The nuspec looks like this

<?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>

推荐答案

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

When using token replacement, make sure your are trying to nuget pack the csproj file, not the nuspec file

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

当 nuspec 与 csproj 文件同名时,会自动选取该文件.

The nuspec is picked up automatically when given the same name as the csproj file.

这篇关于nuget:“替换令牌‘id’没有价值";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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