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

A .NET Core console application to use the library


Let's have a look at using Reflections in this recipe. We have built a small .NET Standard 2.0 library in the last recipe. Now we will be creating a .NET Core-based console application and use reflections to describe our library. We will be using the System.Reflection namespace and a few of its classes 

Getting ready 

Let's make sure you have completed the previous recipe and, if not, complete it and come back to this one. Open Visual Studio 2017 and locate and open the previously built .NET Standard library. 

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 Chapter2.Reflections solution. 
  3. Press Ctrl + Shift + B for a quick build to check that everything is fine. 
  4. Now click on the Chapter2.Reflections solution label. Click File | Add | New Project.
  5. In the Add New Project template dialog box, expand the Visual C# node in the...