The replacement token 'description' has no value——a little cute error about NuGet

At first ,let me introduce the most powerful tool for developers,NuGet!

What is NuGet?

  NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.


common command for NuGet 。

  1、NuGet setApiKey xxxxx-xxxx-xxx-xxxx-xxxx-xxxx (for:setAPIKey of your NuGet count)

  2、NuGet spec (for: create a xxxx.nuspec file)

  3、NuGet  pack  xxxxxx.csproj (for: create a xxxx.nupkg file)

  4、NuGet push xxxxx.nupkg (for: push the nupkg on your NuGetServer ,then your can published your package,and download them from the nuget store)


  today ,i catched the error which is show the message "The replacement token 'description' has no value ". what could trigger thisissue ? wowo, that's so so sinple. you just need know the relationship between the xxx.nuspec file and the  xxxx.csproj file.

  The $description$ value is replaced by AssemblyDescription's value in AssemblyInfo.cs.The project needs to be built before creating the package however.

  How should we know this totally? en hen, OK,let' meet the hole nuspec file

<?xml version="1.0"?>
<package >
  <metadata>
    <id>$id$</id>
    <version>$version$</version>
    <title>$title$</title>
    <authors>$author$</authors>
    <owners>$author$</owners>
    <licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
    <projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
    <iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>$description$</description>
    <releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
    <copyright>Copyright 2016</copyright>
    <tags>Tag1 Tag2</tags>
  </metadata>
</package>

  here ,those variables gonna replaced  by values which came from your Properties\AssemblyInfo.cs file, it 's decide by the config in your Properties\AssemblyInfo.cs file. Let's watch the entire file

   so, did you noticed the flag? that's the reason why we'll met the error  " The replacement token 'description' has no value" here .

How to solve this problem?

   that's easy ! just fill in the blank in your Properties\AssemblyInfo.cs file , and then thexxx.nuspec file can get the value which come from yourProperties\AssemblyInfo.cs file.

   Note : there is no need to moddify thexxxx.nuspec file. Just let it run automaticly . To be a lazy man  haha!


评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值