Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I specify an author if I'm using nuget.exe CLI

Tags:

c#

nuget

How can I specify an author if I'm using nuget.exe CLI?

nuget pack some.csproj -IncludeReferencedProjects

Is there any option like -author? I can't find any in the documentation.

like image 224
FrozenHeart Avatar asked Nov 10 '16 14:11

FrozenHeart


People also ask

How use NuGet command line?

To use any command, open a command window or bash shell, then run nuget followed by the command and appropriate options, such as nuget help pack (to view help on the pack command). This documentation reflects the latest version of the NuGet CLI.

How do I package an EXE to a NuGet package?

You could add the executable to the content folder of the NuGet package. When the package is installed on a project, the executable will then appear as a file in the project. From the NuGet docs: Files in the content folder are copied to the root of your application when the package is installed.

How do I know if NuGet EXE is installed?

In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager. Alternatively, launch the Package Manager Console (Tools > NuGet Package Manager > Package Manager Console) and enter $host to see information about NuGet including the version.

What is the source for NuGet?

Note that the source URL for nuget.org is https://api.nuget.org/v3/index.json .


1 Answers

You need to use the properties command to pass in values for the replacement tokens. You will need to create a new token for authors becaues with the exception of $configuration$, values in the project will be used in preference to any assigned to the same token on the command line and the default $author$ token is pulled from AssemblyCompany in the project.

In the nuspec file

<authors>$CustomAuthor$</authors>

From the command line

nuget pack some.csproj -IncludeReferencedProjects -properties CustomAuthor="Scott Chamberlain"
like image 135
Scott Chamberlain Avatar answered Sep 19 '22 08:09

Scott Chamberlain