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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.