Book Image

C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals - Eighth Edition

By : Mark J. Price
4.6 (14)
Book Image

C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals - Eighth Edition

4.6 (14)
By: Mark J. Price

Overview of this book

This latest edition of the bestselling Packt series will give you a solid foundation to start building projects using modern C# and .NET with confidence. You'll learn about object-oriented programming; writing, testing, and debugging functions; and implementing interfaces. You'll take on .NET APIs for managing and querying data, working with the fi lesystem, and serialization. As you progress, you'll explore examples of cross-platform projects you can build and deploy, such as websites and services using ASP.NET Core. This latest edition integrates .NET 8 enhancements into its examples: type aliasing and primary constructors for concise and expressive code. You'll handle errors robustly through the new built-in guard clauses and explore a simplified implementation of caching in ASP.NET Core 8. If that's not enough, you'll also see how native ahead-of-time (AOT) compiler publish lets web services reduce memory use and run faster. You'll work with the seamless new HTTP editor in Visual Studio 2022 to enhance the testing and debugging process. You'll even get introduced to Blazor Full Stack with its new unified hosting model for unparalleled web development flexibility.
Table of Contents (18 chapters)
17
Index

7 Packaging and Distributing .NET Types

Join our book community on Discord

https://packt.link/EarlyAccess

Qr code Description automatically generated

This chapter is about how C# keywords are related to .NET types, and about the relationship between namespaces and assemblies. You'll become familiar with how to package and publish your .NET apps and libraries for cross-platform use. We also cover how to decompile .NET assemblies for learning purposes and why you cannot prevent others from decompiling your code.In an online-only section, Exercise 7.3 – Porting from .NET Framework to modern .NET, you can learn how to use legacy .NET Framework libraries in .NET libraries and the possibility of porting legacy .NET Framework code bases to modern .NET. In another online-only section, Exercise 7.4 – Creating source generators, you will learn how to create source generators that can dynamically add source code to your projects, a very powerful feature.This chapter covers the following topics:

  • The road to .NET 8
  • Understanding...