Book Image

.NET Standard 2.0 Cookbook

By : Fiqri Ismail
Book Image

.NET Standard 2.0 Cookbook

By: Fiqri Ismail

Overview of this book

The .NET Standard is a standard that represents a set of APIs that all .NET platforms have to implement, making it easy for developers to access and use one common library for their development needs. This book begins with a quick refresher, helping you understand the mechanics of the new standard and offering insight into how it works. You’ll explore the core library concepts, such as working with collections, configurations, I/O, security, and multithreading. You’ll explore the iOS and Android libraries of Xamarin and we’ll guide you through creating a .NET Standard 2.0 library, which you’ll use with both Android and iOS applications. In the final chapters, you’ll learn the various debugging and diagnostics tools to deliver quality libraries and create a NuGet package of the .NET Standard 2.0 library. By the end of this book, you’ll be able to expand your current workflow to various .NET flavors and have the essential skills to create a .NET Standard 2.0 library from scratch to package and deliver it to the world.
Table of Contents (18 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Creating a NuGet package of your library


In this recipe, we will look at how to create a NuGet package out of the library you have just built in the previous recipe. 

Getting ready

Make sure you have completed the previous recipe or that you have a .NET Standard library already with you. Let's get started.

How to do it...

  1. Open Visual Studio 2017.
  2. Now, open the solution from the previous recipe. Click File | Open | Open Project/Solution, or press Ctrl + Shift + O, and select the Chapter11.Packaging solution. 
  3. Now, the Solution Explorer should look like this:

  1. Now, click on the Chapter11.Packaging.CalcLib project label to select it.
  2. Right-click and select Properties.
  3. In the Properties tab, click on the Packages label:

  1. Now, fill in the information and it should look like this:
  1. Now, Save and close.
  2. Again, in the toolbar, select Release from the debugging area:
  1. Now, again in the Solution Explorer, right-click on the Chapter11.Packaging.CalcLib label.
  1. Select Pack:
  1. This should build and create a NuGet package...