
Learn to develop and distribute NuGet packages, sharing your code with other developers. Publish and manage the lifecycle of creating and consuming NuGet packages, with hands-on practice.
Explore the class roadmap for developing and distributing NuGet packages, covering setup, tagging and testing, licensing, spec files, semantic versioning, packaging, local testing, and publishing to nugget dot oag.
Learn how NuGet, the Microsoft supported mechanism for sharing code, packages your functionality into a nugget package and distributes it via nuget.org using the package manager and command line interface.
Develop and distribute a simple NuGet package by coding and unit testing, packaging and testing locally, publishing to NuGet.org, and sharing how to consume its public APIs with the class.
Install the Nugget CLIA by downloading the latest stable version from nugget.org, set environment variables, and verify installation with nugget help showing version 9.3 and commands.
Learn to create and distribute a simple nugget package by building a calculator library in a Dotted Standard class library, adding unit tests, and packaging with Visual Studio.
Demonstrates writing a calculator in a NuGet package, implementing add, subtract, multiply, and divide in a calculator class, and validating with unit tests using Visual Studio and Test Explorer.
Think from a consumer perspective to design a NuGet package, exposing the add helper through public classes while using internal modifiers and InternalsVisibleTo for unit tests across assemblies.
Recap introducing NuGet, reviewing the last project, installing the CLI, and writing unit tests for a package. Create and test the NuGet package locally and prepare for publishing to nuget.org.
Prepare a release folder for a NuGet package by placing dlls, the license file, and the spec file in the structure, then use NuGet pack to generate a valid package.
Update the build output path so the release folder includes a library subfolder, enabling the nugget package to be generated locally.
Learn to create and fill a .nuspec file, detailing id, version, title, authors, license, icon, and release notes, to publish NuGet packages on nuget.org.
Learn how semantic versioning 1.0 uses major, minor, and patch components to signal breaking changes, new features, or bug fixes, and how pre-release suffixes and version resets work.
Add a license file at solution root by creating a solution items folder and a license.md, using an MIT template and customizing the year and name; explore licenses at choosealicense.com.
Configure post-build events to copy the license file and the nugget specification file from the solution directory into the project output, overriding existing files as needed.
Switch to the release version, build the solution, and generate the NuGet spec file to package the library into a NuGet package named online class demo in spec.
Unpacking the .nupkg exposes a zip-like package with a nuspec and license, a library folder with the dll, and a content types map plus metadata and rsls relationship files.
Test your nuget package locally by creating a local feed folder, configuring package sources in Visual Studio, and installing the package into a console app to verify results.
Review milestone one outcomes by creating the nuget package, adding license and spec files, building locally, inspecting contents, and testing it. Next, prepare to publish the nuget package.
Create a nuget.org account using a Microsoft account and register with a username. Review your account settings and enable two-factor authentication via SMS to verify your identity.
Create and manage an API key to publish NuGet packages, including naming, setting a scope, expiration, copying the key, and options to regenerate, edit, or delete.
Publish your nuget package to nuget.org by pushing with the api key and nuget.org feed. It moves from pending validation to listed and published, with an email after an hour.
Understand nuget, install locally, build a calculator nugget package with unit tests; apply public to internal, prepare release with license, semantic versioning 1.4, and publish via api key.
Provide feedback to help improve this class. Follow the teacher profile, share the class with your network, and submit your class project with reflections on using your nugget package.
NuGet is the Microsoft-supported mechanism for sharing code. It is a definition of how re-usable code is created for .NET projects and bundled into NuGet packages. It is a tool that helps you create a NuGet package. It is a platform where you can publish your NuGet packages to and share it with other developers. It is a package manager that is integrated with Visual Studio which you can use to consume these NuGet packages. How amazing is that!
In this class you will learn how to develop your very own NuGet package and then publish it to NuGet org! Doesn’t that sound exciting? You will learn what is NuGet in more depth, how to align your thinking when taking the NuGet approach and a lot more.
Project
Your class project is a simple 4-step process as outlined below.
Develop & unit test – Think of a simple idea that your NuGet package will solve. Write some code for it and some unit tests to verify the accuracy of your code and make it maintainable for the future.
Pack & test locally – Create a NuGet package locally and test it locally by setting up a local NuGet feed. Unpackage the NuGet to ensure your files are in there.
Publish to NuGet org – Once confident, publish your NuGet package to NuGet org.
Share the link with this class – Hooray! Now, share the link of your NuGet package with this class. When sharing your class project:
Submit the link to your NuGet org package.
Write about how to use your NuGet package.
Write about your experience of the process.
Watch the class project video for some ideas!
Do follow my teacher profile to stay up-to-date on classes I post and please share this class with your network. And at the end of this class please do not forget to share your reviews about this class.
Happy learning!