This project has moved. For the latest updates, please go here.

Nuspec breaks creating nuget package

Jul 1, 2014 at 3:39 PM
Edited Jul 1, 2014 at 3:40 PM
I'm running CreateNewNuGetPackageFromProjectAfterEachBuild (I have Nuget 2.8). Using VS 2013 Update 2.

Everything works until I create a .nuspec file and then I get this error. Any help appreciated. Here's my nuspec file generated from Nuget:

<?xml version="1.0"?>
<package >
<metadata>
<id>$id$</id>
<version>1.0.2</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 2014</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
</package>


Building NuGet package in Post-Build event...
1> Pre-processing the project file to make sure the assembly exists where NuGet.ex
1> e will expect it to be, started at 16:28:15.5261826.
1> The Output Directory is the same as defined in the project file, so no pre-proc
1> essing actions were required.
1> Pre-processing the project file finished running at 16:28:15.5591859. Completed
1> in 0.0330033 seconds.
1> VERBOSE: New-NuGetPackage script started running at 16:28:15.5841884.
1> VERBOSE: About to run Pack command '&
1> "F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\PostBui
1> ldScripts\NuGet.exe" pack
1> "F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\Paginat
1> ionHelpers.csproj" -OutputDirectory
1> "F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\bin\Deb
1> ug" -Properties Configuration="Debug"`;Platform="AnyCPU" -NonInteractive '.
1> Attempting to build package from 'PaginationHelpers.csproj'.
1> Packing files from 'F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\Pagina
1> tionHelpers\bin\Debug'.
1> Using 'PaginationHelpers.nuspec' for metadata.
1> The replacement token 'author' has no value.
1> VERBOSE: Performing any required New-NuGetPackage script cleanup...
1> An error occurred while running New-NuGetPackage script:
1> Could not determine where NuGet Package was created to. Perhaps an error occurred while packing it. Look for errors from NuGet above (in the console window).
1>
1> Could not determine where NuGet Package was created to. Perhaps an error occurr
1> ed while packing it. Look for errors from NuGet above (in the console window).
1> At F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\PostB
1> uildScripts\New-NuGetPackage.ps1:1159 char:12
1> + throw <<<< "Could not determine where NuGet Package was created
1> to. Perhaps an error occurred while packing it. Look for errors from NuGet abov
1> e (in the console window)."
1> + CategoryInfo : OperationStopped: (Could not deter...onsole wind
1> ow).:String) [], RuntimeException
1> + FullyQualifiedErrorId : Could not determine where NuGet Package was crea
1> ted to. Perhaps an error occurred while packing it. Look for errors from N
1> uGet above (in the console window).
1>
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4507,5): error MSB3073: The command "REM Create a NuGet package for this project and place the .nupkg file in the project's output directory.
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4507,5): error MSB3073: ECHO Building NuGet package in Post-Build event...
1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4507,5): error MSB3073: PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& 'F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\PostBuildScripts\BuildNewPackage-RanAutomatically.ps1' -ProjectFilePath 'F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\PaginationHelpers.csproj' -OutputDirectory 'F:\TFSOnline\ControlCentre\ControlCentreLibrary\main\PaginationHelpers\bin\Debug\' -Configuration 'Debug' -Platform 'AnyCPU'"" exited with code 1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Coordinator
Jul 1, 2014 at 4:54 PM
This line describes the problem:

"The replacement token 'author' has no value."

The problem is that your project properties don't have an Author defined; this is a requirement of NuGet. You can either hard-code it into your .nuspec file, or else you need to put it in your project's properties (i.e. the AssemblyInfo.cs file). You can get to it through Visual Studio by right-clicking on your project, choosing Properties, and then on the Application tab hit the "Assembly Information..." button.
Marked as answer by deadlydog on 7/2/2014 at 8:47 AM
Jul 2, 2014 at 8:42 AM
Thanks - that worked a treat