Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tools and Skills for .NET 8

You're reading from   Tools and Skills for .NET 8 Get the career you want with good practices and patterns to design, debug, and test your solutions 

Arrow left icon
Product type Paperback
Published in Jul 2024
Publisher Packt
ISBN-13 9781837635207
Length 778 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Mark J. Price Mark J. Price
Author Profile Icon Mark J. Price
Mark J. Price
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Preface 1. Introducing Tools and Skills for .NET FREE CHAPTER 2. Making the Most of the Tools in Your Code Editor 3. Source Code Management Using Git 4. Debugging and Memory Troubleshooting 5. Logging, Tracing, and Metrics for Observability 6. Documenting Your Code, APIs, and Services 7. Observing and Modifying Code Execution Dynamically 8. Protecting Data and Apps Using Cryptography 9. Building an LLM-Based Chat Service 10. Dependency Injection, Containers, and Service Lifetime 11. Unit Testing and Mocking 12. Integration and Security Testing 13. Benchmarking Performance, Load, and Stress Testing 14. Functional and End-to-End Testing of Websites and Services 15. Containerization Using Docker 16. Cloud-Native Development Using .NET Aspire 17. Design Patterns and Principles 18. Software and Solution Architecture Foundations 19. Your Career, Teamwork, and Interviews 20. Epilogue 21. Index

Using .NET 9 with this book

Microsoft will release .NET 9 at the .NET Conf 2024 on Tuesday, November 12, 2024, one week after the US Presidential election on November 5. Many readers will want to use this book with .NET 9, so this section explains how.

At the time of publishing in July 2024, .NET 9 is already available in preview, or you can wait for the final version in November 2024. But beware because once you install a .NET 9 SDK, then it will be used by default for all .NET projects unless you override it using a global.json file. You can learn more about doing this at the following link: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json.

You can easily continue to target the .NET 8 runtime while installing and using future C# compilers, as shown in Figure 1.4 and illustrated in the following list:

  1. November 2023 onwards: Install .NET SDK 8.0.100 or later and use it to build projects that target .NET 8 and use the C# 12 compiler by default. Every month, update to .NET 8 SDK patches on the development computer and update to .NET 8 runtime patches on any deployment computers.
  2. February to October 2024: Optionally, install .NET SDK 9 previews each month to explore the new C# language and .NET library features. Note that you won’t be able to use new library features while targeting .NET 8. Read the monthly announcement posts to find out about the new features in that preview, found at the following link: https://github.com/dotnet/core/discussions/9234.
  3. November 2024 onwards: Install .NET SDK 9.0.100 or later and use it to build projects that continue to target .NET 8 and use the C# 13 compiler for its new features. You will be using a fully supported SDK and fully supported runtime. You can also use new features in EF Core 9 because it will continue to target .NET 8.
  4. February to October 2025: Optionally, install .NET 10 previews to explore new C# language and .NET library features. Start planning if any new library and ASP.NET Core features in .NET 9 and .NET 10 can be applied to your .NET 8 projects when you are ready to migrate.
  5. November 2025 onwards: Install .NET 10.0.100 SDK or later and use it to build projects that target .NET 8 and use the C# 14 compiler. You could migrate your .NET 8 projects to .NET 10 since it is a long-term support (LTS) release. You have until November 2026 to complete the migration when .NET 8 reaches end-of-life.
A screenshot of a computer program

Description automatically generated

Figure 1.4: Targeting .NET 8 for long-term support while using the latest C# compilers

When deciding to install a .NET SDK, remember that the latest is used by default to build any .NET projects. Once you’ve installed a .NET 9 SDK preview, it will be used by default for all projects, unless you force the use of an older, fully supported SDK version like 8.0.100 or a later patch.

To gain the benefits of whatever new features are available in C# 13, while still targeting .NET 8 for long-term support, modify your project file, as shown highlighted in the following markup:

<Project Sdk="Microsoft.NET.Sdk">
 
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <LangVersion>13</LangVersion> <!--Requires .NET 9 SDK GA-->
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>
</Project>

Good Practice

Use a general availability (GA) SDK release like .NET 9 to use new compiler features while still targeting older but longer supported versions of .NET like .NET 8.

You have been reading a chapter from
Tools and Skills for .NET 8
Published in: Jul 2024
Publisher: Packt
ISBN-13: 9781837635207
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image