Skip to content

Instantly share code, notes, and snippets.

@weeksdev
Created January 16, 2020 16:19
Show Gist options
  • Save weeksdev/384ce2c4fc590d10c3ab2d386f85ff84 to your computer and use it in GitHub Desktop.
Save weeksdev/384ce2c4fc590d10c3ab2d386f85ff84 to your computer and use it in GitHub Desktop.
Nuget Commands

Creating nuspec file

Go to the path with the .csproj file

Run the following command:

nuget spec

Filling out assembly info

Open the .nuspec file and fill in fields or delete lines not needed. Leave the id line as is.

Creating .nupkg file Run the following command:

nuget pack YOUR_PROJECT.csproj -MsBuildPath "C:\Program Files (x86)\MSBuild\14.0\Bin" -Properties Configuration=Release -OutputDirectory "./artifacts/"

In dotnet core use:

dotnet pack YOUR_PROJECT.csproj -o ../artifacts

Pushing your changes to the nuget server

Run the following command

nuget push ./artifacts/YOUR_PROJECT_VERSION_PACKAGE.nupkg -Source https://your/feed

dotnet nuget push ./artifacts/YOUR_PROJECT_VERSION_PACKAGE.nupkg --source https://your/feed

Alternate

Run dotnet msbuild .\YOUR_PROJECT.csproj

nuget push ./bin/release/YOUR_PROJECT_VERSION_PACKAGE.nupkg -Source https://your/feed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment