This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
NuGet Packaging and Publishing
jpo424 edited this page Sep 29, 2017
·
6 revisions
- Download the latest stable version from https://www.nuget.org/downloads
- Place the exe in a safe/permanent place somewhere in your /Users directory; give it it's own folder
- Add the above created folder to your PATH Windows environment variable.
- Open up console, confirm
nuget
command does something - To configure:
nuget setApiKey <key>
NOTE: In our repo now is an already generated .nuspec
file. This file is THE prerequisite for packaging and publishing to NuGet. To generate this file, I navigated to the repo folder with YChartsApi.sln
file and ran nuget spec
. When that file is generated in this manner, variables are tokenized(like string templating) to pull assembly/package meta data directly from AssemblyInfo.cs
. Every time we want to change our deployed NuGet package, like changing version numbers, we edit that file.
- After code is committed and
AssemblyInfo.cs
is updated, runnuget pack YChartsApi.csproj -Prop Configuration=Release
. That will create a file of type.nupkg
in the current directory. This is the file we push to NuGet
nuget push YChartsAp<assembly file version>.nupkg -Source https://www.nuget.org
NOTE: After a package is push to NuGet, it typically takes about 10 minutes for it be indexed and available for download/install.