Wednesday, 22 April 2015

The replacement token 'id' has no value

When trying to manually build a NuGet package from the command line with the following command

nuget pack Trial.nuspec

You may recieve the following error:
Attempting to build package from 'Trial.nuspec'.
The replacement token 'id' has no value.
This will be likely if you are using tokens in the nuspec file. Example:
<?xml version="1.0"?>
<package >
    <releaseNotes>Initial release.</releaseNotes>
    <copyright>Copyright 2015</copyright>
    <file src="bin\$configuration$\*" target="" />

If this is the case, run the same command prompt but pass in the csproj file instead.

nuget pack Trial.csproj

No comments: