Creating the metadata in NuGet spec file

Go to the root directory of your project and copy the downloaded CLI file, nuget.exe, there. Open a console window, navigate to the project directory, and enter either of the following commands to create the nuspec file:

    nuget spec
    nuget spec NuGetDemoLibrary.csproj
    nuget spec bin\Release\NuGetDemoLibrary.dll

For the previously mentioned NuGet commands, please note the following:

  • If you use the first command nuget spec, it will create the nuspec file based on the available project files in the directory where it was executed.
  • The nuget spec <ProjectFilePath> will create the nuspec file only for the project that you specified.
  • If you use a specific DLL, in this fashion-- nuget spec <DllFilePath> ...

Get Mastering Visual Studio 2017 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.