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 an ASP.NET Core application in Ubuntu to use the library


We will be creating an ASP.NET Core application to use the library in this recipe. ASP.NET Core will be using the MVC design pattern, as well as working in Linux, macOS, and, of course, in Windows. We will be using Ubuntu as the operating system for building this small app to demonstrate the cross-platform capabilities of .NET Core.

Getting ready

Make sure you have completed the previous recipe that includes setting up the environment and building of the .NET Standard 2.0 library that creates a text file as a log. This recipe assumes you have basic knowledge of MVC architecture. In simple terms, MVC is a software architectural pattern that separates data models, controlling code, and user interfaces. Let's have a look at how to build this application and use our library.

How to do it..

  1. Open the terminal and navigate to the root of your application built in the previous recipe.
  2. The directory structure should look like this:
  1. Now type...