Publish c# code library to NuGet

There are many complicated ways to publish your library to NuGet, but there is one very quick and very simple way…

Basically, to publish your library — you need to create a Nuget package and then upload it.

The package can be generated on the Build of the program. Before you initiate that, you need to go to Properties and then go to Package tab.

Once here, you will need to check the “Generate NuGet package on build” box. If checked, the package will be generated every time you build your program. You can also add some data about the library, this will be publicly visible on NuGet. It is also important to note, that if you check “Require license acceptance” box — you must also provide the license, otherwise it will fail.

You will find the package in project directory >> bin >> Release (if you chose “Release” build).

Finally, to upload the package, you will need to go to nuget.org, then log in with your Microsoft account, go to “upload” page and upload the package.

--

--