.NET Standard 2.0 Cookbook
eBook - ePub

.NET Standard 2.0 Cookbook

Develop high quality, fast and portable applications by leveraging the power of .NET Standard Library

Fiqri Ismail

Compartir libro
  1. 394 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

.NET Standard 2.0 Cookbook

Develop high quality, fast and portable applications by leveraging the power of .NET Standard Library

Fiqri Ismail

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Get the most out of.NET framework using standard libraries and create a.NET Standard 2.0 library from scratchAbout This Book• Write code once and share within.NET ecosystem in Windows, Linux and macOS• Give your.NET Libraries a common framework in cloud and on premise with the latest.NET Standard 2.0• Build a wide range of applications from Mobile with Xamarin to Web with ASP.NETWho This Book Is ForThis book is for.NET developers who are looking to build dynamic applications with the latest.NET Standard. C# knowledge is required.What You Will Learn• Create a.NET Standard 2.0 library• Use System.IO within the.NET Standard 2.0• Make use of your legacy.NET libraries with the new.NET Core standard• Explore the thread support to create a multithreaded.NET Standard 2.0 library• Create a.NET Standard 2.0 library and use it with an Android and iOS application• Implement various Visual Studio 2017 diagnostics and debugging tools• Create a NuGet Package and submit the package to the NuGet Package Manager • Use Visual Studio 2017 azure tools to deploy the application to Azure• Test and deliver a.NET Standard 2.0 libraryIn DetailThe.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.Style and approachA recipe-based approach to help you get the most out of the.NET Standard 2.0 Library that can be implemented to all the.NET Platforms

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es .NET Standard 2.0 Cookbook un PDF/ePUB en línea?
Sí, puedes acceder a .NET Standard 2.0 Cookbook de Fiqri Ismail en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming in C#. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2018
ISBN
9781788838726
Edición
1

Working with Files

In this chapter, we will be looking at these recipes:
  • Setting up .NET Core in Ubuntu
  • Creating a log as text
  • Creating an ASP.NET Core application in Ubuntu to use the library
  • Setting up .NET Core in macOS
  • Reading from a comma separated (CSV) text file
  • Creating a .NET Core console application in macOS to use the library
  • Compressing? Why not?
  • Creating a classic Windows application to use the library
  • Encrypting and Decrypting content in a text file
  • Creating a classic Windows application to use the library

Technical requirements

Readers should have a basic knowledge of C#. They should also have a basic knowledge of using Visual Studio, installing packages using NuGet, and referencing libraries within projects from other projects.
The code files for this chapter can be found on GitHub:
https://github.com/PacktPublishing/DotNET-Standard-2-Cookbook/tree/master/Chapter03
Check out the following video to see the code in action:
https://goo.gl/82FCEP

Introduction

As a developer, at some point, we will have to write some data to the disk or read data from the disk. This may be a simple text file, or may be a log file in a system you have written. .NET Framework offers great support for working with files. Mainly, we will be looking at the System.IO namespace and its usage of it.
In this chapter, we will be looking at some cross-platform applications as well. Each recipe will go through setting up new environments, such as Ubuntu and macOS, as well as building a .NET Standard 2.0 library and an accompanying application that uses the library.

Setting up .NET Core in Ubuntu

In this recipe, we will be going through how to set up .NET Core 2.x in an Ubuntu system. Ubuntu is a widely used Debian-based Linux environment. By visiting https://www.ubuntu.com/desktop, you can easily download and install Ubuntu on your system. You may have to use a virtual PC to do this. There are two great free tools that you can use:
  1. VMWare Workstation Player for Windows: https://www.vmware.com/products/workstation-player.html
  2. Oracle Virtual Box for Windows, Linux, and macOS: https://www.virtualbox.org/wiki/Downloads
This chapter assumes you have already set up and installed the required operating systems.

Getting ready

You will have to download a virtual PC and install the latest version of Ubuntu. If you haven't got a virtual PC that runs Ubuntu, make sure you have before continuing this recipe done it yet. I am using Ubuntu version 16.04 here. To find out which version you have, simply type the following command in the terminal:
$ lsb_release -a
You should get the following output:

How to do it...

  1. Open your favorite browser, type the following URL, and press Enter:
    https://www.microsoft.com/net/download/linux
  1. Select the Install .NET Core SDK 2.x Package button.
  1. From the Linux Distribution drop-down list, select Ubuntu 16.04.
  1. Follow the instructions on the page to install the current SDK or perform the following steps to install.
  2. Now open the terminal, type the following command, and press Enter:
 $ curl https://packages.microsoft.com/keys/microsoft.asc | 
gpg --dearmor > microsoft.gpg
  1. If you have a fresh installation of Ubuntu you might not have curl installed. If not use the following command to install curl:
 $ sudo apt-get install curl 
  1. Now, again in the terminal type the following command and press Enter to get the list of files:
 $ sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
  1. Type the following command and press Enter in the terminal:
 $ sudo sh -c 'echo "deb [arch=amd64] 
https://packages.microsoft.com/repos/
micro...

Índice