39,59 €
C# and .NET remain the backbone of modern enterprise and cross-platform development. Whether you're building high-performance websites and services on Windows or Linux or desktop apps that run on Windows and macOS, the .NET ecosystem provides a mature yet constantly evolving foundation for software development. With the release of C# 14 and .NET 10, developers now have access to a more powerful toolset.
This tenth edition has been thoroughly updated to reflect the latest features. It begins with a deep grounding in object-oriented programming and then walks you through building, testing, and debugging functions, as well as managing resources with .NET libraries. You'll work with data using LINQ and serialization, handle filesystem operations, and integrate new features like numerical string comparisons and OrderedDictionary improvements. This book explains C# 14 updates, such as field modifiers, partial events, and instance constructors, in a real-world context. It also guides you in building practical projects with ASP.NET Core 10, exploring Blazor and Minimal API web services that support AOT compilation—ideal for microservices and containers.
By the end of the book, you’ll be ready to ship professional websites, services, and tools across platforms, confident in your ability to build software that's maintainable, efficient, and aligned with modern .NET development.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 1149
Veröffentlichungsjahr: 2025
C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals
Tenth Edition
Build modern websites and services with ASP.NET Core, Blazor, and EF Core using Visual Studio 2026
Mark J. Price
C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals
Tenth Edition
Copyright © 2025 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Portfolio Director: Ashwin Nair
Relationship Lead: Suman Sen
Project Manager: Ruvika Rao
Content Engineer: Hayden Edwards
Technical Editor: Arjun Varma
Copy Editor: Safis Editing
Indexer: Pratik Shirodkar
Proofreader: Hayden Edwards
Production Designer: Ajay Patule
Growth Lead: Priyadarshini Sharma
First published: March 2016
Second edition: March 2017
Third edition: November 2017
Fourth edition: October 2019
Fifth edition: November 2020
Sixth edition: November 2021
Seventh edition: November 2022
Eighth edition: November 2023
Ninth edition: November 2024
Tenth edition: November 2025
Production reference: 1041125
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK.
ISBN 978-1-83620-663-7
www.packtpub.com
Mark J. Price is a Microsoft Specialist: Programming in C# and Architecting Microsoft Azure Solutions, with over 20 years of experience. Since 1993, he has passed more than 80 Microsoft programming exams and specializes in preparing others to pass them. Between 2001 and 2003, Mark was employed to write official courseware for Microsoft in Redmond, USA. His team wrote the first training courses for C# while it was still an early alpha version. While with Microsoft, he taught “train-the-trainer” classes to get Microsoft Certified Trainers up-to-speed on C# and .NET. Mark has spent most of his career training a wide variety of students, from 16-year-old apprentices to 70-year-old retirees, with the majority being professional developers. Mark holds a BSc in Computer Science.
Thank you to all my readers. Your support means I get to write these books and celebrate your successes. Special thanks to the readers who give me actionable feedback via my GitHub repository and email, and interact with me and the book communities on Discord. You help make my books even better with every edition.
Kieran Foot is a self-taught C# developer with a deep passion for learning new technologies and techniques. He is constantly exploring the latest developments in C#, with a particular focus on web technologies. As the lead software developer at ConnX Business Solutions, a small software company based in the UK, he has the opportunity to apply his knowledge in practice and assist others in acquiring new skills. He enjoys helping others and is an active member of the Packt community.
Pavel P. Oleynik has a Ph.D. in Computer Science and is the author of more than 100 scientific papers in various languages. He organized and regularly conducted the International Theoretical and Practical Conference, Object Systems. He has been developing software since 1999 and has held the positions of team leader, technical leader, architect, and CTO in multibillion-dollar holdings. He is a recognized expert in areas such as heavy industry, coal industry, agricultural industry, banking, fintech, healthcare, retail, ERP/MES systems, SCM, ITSM, low-code/no-code systems, and foodtech.
To join the Discord community for this book – where you can share feedback, ask questions to the author, and learn about new releases – follow this QR code:
https://packt.link/cs14net10
Staying sharp in .NET takes more than reading release notes. It requires real-world tips, proven patterns, and scalable solutions. That’s what .NETPro, Packt’s new newsletter, is all about.
Scan the QR code or visit the link to subscribe:
https://landing.packtpub.com/dotnetpronewsletter/
Once you’ve read C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals, Tenth Edition, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.
Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.
This book comes with free benefits to support your learning. Activate them now for instant access (see the “How to Unlock” section for instructions).
Here’s a quick overview of what you can instantly unlock with your purchase:
PDF and ePub Copies
Next-Gen Web-Based Reader
Access a DRM-free PDF copy of this book to read anywhere, on any device.
Multi-device progress sync: Pick up where you left off, on any device.
Use a DRM-free ePub version with your favorite e-reader.
Highlighting and notetaking: Capture ideas and turn reading into lasting knowledge.
Bookmarking: Save and revisit key sections whenever you need them.
Dark mode: Reduce eye strain by switching to dark or sepia themes.
Scan the QR code (or go to packtpub.com/unlock). Search for this book by name, confirm the edition, and then follow the steps on the page.
Note: Keep your invoice handy. Purchases made directly from Packt don’t require one.
In this first chapter, the main goal is to set up your development environment to use Visual Studio 2026, Visual Studio Code, or JetBrains Rider.
Throughout this book, I will use the names Visual Studio, VS Code, and Rider to refer to these three code editors, respectively.
The other goals are understanding the similarities and differences between modern .NET, .NET Core, .NET Framework, Mono, Xamarin, and .NET Standard; creating the simplest application possible with C# 14 and .NET 10, using various code editors; discovering good places to look for help; and learning how to make the most of modern AI workflows.
My style of writing ensures that you can get started from my book and then switch to online documentation and other online resources, like videos, blogs, and forums, which are the main ways that developers like to learn, as shown at the following link: https://survey.stackoverflow.co/2025/developers#2-how-did-you-learn-to-code.
This chapter covers the following topics:
Introducing this book and its contentsSetting up your development environmentUnderstanding .NETBuilding console apps and managing multiple projects in a solutionMaking good use of the GitHub repository for this bookRunning a C# code file without a project fileLooking for helpYour purchase includes a free PDF copy of this book along with other exclusive benefits. Check the Free Benefits with Your Book section in the Preface to unlock them instantly and maximize your learning experience.
Let’s get started by introducing you to the code solutions, structure, and content of this book.
You can complete all the coding tasks just from reading this book because all the code statements that you need to enter are shown in the pages. You do not need to download or clone the solution code to complete this book. The solution code is provided in the GitHub repository only so that you can view it if you get stuck working from the book, and to save you time from entering long files yourself. It is also more reliable to copy from an actual code file than from a PDF or other e-book format.
The GitHub repository for this book has solutions that use full application projects for all code tasks and exercises, found at the following link:
https://github.com/markjprice/cs14net10.
After navigating to the GitHub repository in your web browser, you can press the . (dot) key on your keyboard, or manually change .com to .dev in the link to convert the repository into a live code editor based on VS Code, called GitHub Codespaces, as shown in Figure 1.1:
Figure 1.1: GitHub Codespaces viewing the book’s GitHub repository
Warning! When you access a repository using GitHub Codespaces, its GitHub Repositories extension will attempt to download the repository’s index. By default, the maximum size can be up to 50 MB, but the repository exceeds this limit, so you will see the following warning message: Repository exceeds download size limit! Continuing with partial text services. You can ignore this message because you are not using the full features.
VS Code in a web browser is great to run alongside your chosen local code editor as you work through the book’s coding tasks. You can compare your code to the solution code and easily copy and paste parts if needed.
You do not need to use or know anything about Git to get the solution code of this book. You can download a ZIP file containing all the code solutions by using the following direct link and then extracting the ZIP file into your local filesystem: https://github.com/markjprice/cs14net10/archive/refs/heads/main.zip.
Throughout this book, I use the term modern .NET to refer to .NET 10 and its predecessors, like .NET 6, that derive from .NET Core. I use the term legacy .NET to refer to .NET Framework, Mono, Xamarin, and .NET Standard. Modern .NET is a unification of those legacy platforms and standards.
Most people learn complex topics best by imitation and repetition, rather than reading a detailed explanation of the theory; therefore, I will not overload you with detailed explanations of every step throughout this book. The idea is to get you to write some code and see it run.
You don’t need to know all the nitty-gritty details immediately. That will be something that comes with time as you build your own apps and go beyond what any book can teach you.
In the words of Samuel Johnson, author of the English dictionary in 1755, I have committed “a few wild blunders, and risible absurdities, from which no work of such multiplicity is free.” I take sole responsibility for these and hope you appreciate the challenge of my attempt to lash the wind by writing this book about rapidly evolving technologies, like C# and .NET, and the apps that you can build with them.
If you have a complaint about this book, then please contact me before writing a negative review on Amazon. Authors cannot respond to Amazon reviews, so I cannot contact you to resolve the problem and help you, or listen to your feedback and try to do better in the next edition. Please ask a question on the Discord channel for this book at https://packt.link/cs14net10, email me at [email protected], or raise an issue in the GitHub repository for the book at the following link: https://github.com/markjprice/cs14net10/issues.
The following topics are covered in this book:
Language fundamentals: Fundamental features of the C# language, from declaring variables to writing functions and object-oriented programming.Library fundamentals: Fundamental features of the .NET base class library, as well as some important optional packages for common tasks like database access.Modern web development fundamentals: Modern features of the ASP.NET Core framework for server-side and client-side website and web service development. This includes Blazor and Minimal API web services and excludes controller-based features like MVC and Web API, or legacy features like Razor Pages.This book, C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals, is best read linearly, chapter by chapter, because it builds up fundamental skills and knowledge.
Now that you know what this book covers, let’s review what the other three books in the quartet cover.
The following topics are available in a companion book, Real-World Web Development with .NET 10:
ASP.NET Core MVC: Build websites using a mature and proven Model-View-Controller architecture patternASP.NET Core Web API: Build web services using controllersOData and FastEndpoints: Build web services using specialized librariesTesting and Containerization: Test web user interfaces and containerize your web projects ready for deploymentUmbraco CMS: Build websites with content managed by end usersThe first half of this book should be read linearly, and the second half can be read more like a cookbook, so if you are especially interested in building web services using FastEndpoints, then you can read that chapter without the preceding chapters about ASP.NET Core OData web services.
The following topics are available in a companion book, Apps and Services with .NET 10:
User interfaces: Avalonia for desktop apps, Blazor for web apps, and .NET MAUI for mobile appsSpecialized libraries: Dates, times, time zones, and internationalization; common third-party libraries for image handling, logging, mapping, and generating PDFs; and many moreData: SQL Server, ADO.NET, Dapper, and EF CoreServices: Caching, queuing, background services, gRPC, GraphQL, SignalR, and Minimal API web servicesThis book can be read like a cookbook, so if you are especially interested in building gRPC services, then you can read that chapter without the preceding chapters about ASP.NET Core Minimal API web services.
The following topics are available in a companion book, Tools and Skills for .NET 10:
Mastering the features of your code editor, Visual Studio or VS CodeSource code control with GitDebugging and memory analysisCryptography, multitasking and concurrencyAll the important types of testing, from unit and integration to performance and web UI testingDocker and Aspire for local distributed development and testingDesign patterns and solution architecturePreparing for an interview to get the .NET developer career that you wantThis book can be read like a cookbook.
I use my personal GitHub repository to store shared content that is relevant to all my books. Useful sections include the following:
FAQs: https://github.com/markjprice/markjprice/blob/main/FAQs.mdArticles: https://github.com/markjprice/markjprice/blob/main/articles/README.mdFor example, now that Rider is free for non-commercial use, its popularity has grown more than VS Code, as shown at the following link:
https://github.com/markjprice/markjprice/blob/main/articles/surveys.md#net-developers-community-on-linkedin.
So, in this 10th edition, I have streamlined this book by moving most VS Code content online and focusing on Visual Studio, which is by far still the most popular IDE for .NET developers, especially beginners.
To see a list of all the books I have published with Packt, you can use the following link:
https://subscription.packtpub.com/search?query=mark+j.+price.
A similar list is available on Amazon:
https://www.amazon.com/Mark-J-Price/e/B071DW3QGN/.
You can search other book-selling sites for my books, too.
Before you startprogramming, you’ll need a code editor for C#, either from Microsoft or a third party.
Microsoft has a family of code editors and Integrated Development Environments (IDEs), which include the following:
Visual Studio for WindowsVS Code for Windows, macOS, or LinuxVS Code for the Web or GitHub CodespacesThird parties have created their own C# code editors; for example, JetBrains has the cross-platform Rider, which is available for Windows, macOS, or Linux, and since October 2024, is free for non-commercial use. Rider is popular with more experienced .NET developers.
Warning! Although JetBrains is a fantastic company with great products, both Rider and the ReSharper extension for Visual Studio are software, and all software has bugs and quirky behavior. For example, they might show errors like Cannot resolve symbol in your Razor Pages, Razor views, and Blazor components. Yet you can build and run those files because there is no actual problem. If you have installed the Unity Support plugin, then it will complain about boxing operations (which are a genuine problem for Unity game developers), but in projects that are not Unity, hence, the warning is not applicable.
Most readers use Visual Studio, which is a large and complex tool that can do many things. But Visual Studio likes to provide its own mechanism to do as much as possible, and a .NET developer who uses it could easily think that Visual Studio is the only way to complete a .NET-related task, like modifying project configuration or editing a code file.
Always try to remember that Visual Studio and all the other code editors are just tools that do work for you that you could do manually. They just show you a view above what is really happening in the files you’re working on, like the project file and all the C# code files, as shown in Figure 1.2. You could just use a plain text editor to manually edit the project and code files. Ultimately, you use the dotnet command-line interface to compile (aka build) the project files into a runnable assembly packaged as either a .dll or .exe file.
Figure 1.2: All code editors ultimately just change underlying text files
A new feature in .NET 10 is support for executing a C# code file without a .csproj project file. There is a section at the end of this chapter with a coding task to cover this new feature.
What is the best tool and application type for learning C# and .NET?
When learning, the best tool is one that helps you write code and configuration, but does not hide what is really happening. IDEs provide graphical user interfaces that are friendly to use, but what are they doing for you underneath? A more basic code editor that is closer to the action, while providing help to write your code, can be better while you are learning.
Having said that, you could make the argument that the best tool is the one you are already familiar with or that you or your team will use as your daily development tool. For that reason, I want you to be free to choose any C# code editor or IDE to complete the coding tasks in this book, including VS Code, Visual Studio, and even Rider.
In this book, I give detailed step-by-step instructions in this chapter on how to create multiple projects in both Visual Studio and VS Code. There are also links to online instructions for other code editors, as shown at the following link: https://github.com/markjprice/cs14net10/blob/main/docs/code-editors/README.md.
In subsequent chapters, I will only give the names of projects along with general instructions, so you can use whichever tool you prefer.
The best application type for learning the C# language constructs and many of the .NET libraries is one that does not distract with unnecessary application code. For example, there is no need to create an entire Windows desktop application or a website just to learn how to write a switch statement.
For that reason, I believe the best method for learning the C# and .NET topics in Chapters 1 to 11 is to build console apps. Then, in Chapters 12 to 15, which are about web development, you will build web projects using the modern parts of ASP.NET Core, including Blazor web apps and Minimal API web services.
The most modern and lightweight code editor to choose from, and the only one from Microsoft that is cross-platform, is VS Code. It can run on all common operating systems, including Windows, macOS, and many varieties of Linux, including Red Hat Enterprise Linux (RHEL) and Ubuntu.
VS Code is a good choice for modern cross-platform development because it has an extensive and growing set of extensions to support many languages beyond C#. The most important extension for C# and .NET developers is the C# Dev Kit, as it turns VS Code from a general-purpose code editor into a tool optimized for C# and .NET developers.
You can read about the C# Dev Kit extension in the official announcement at the following link: https://devblogs.microsoft.com/visualstudio/announcing-csharp-dev-kit-for-visual-studio-code/.
Being cross-platform and lightweight, VS Code and its extensions can be installed on all platforms that your apps will be deployed to for quick bug fixes and so on. Choosing VS Code means a developer can use a cross-platform code editor to develop cross-platform apps. VS Code is supported on ARM processors so that you can develop on Apple Silicon computers, Windows ARM devices like Surface Laptop 7, and Raspberry Pi computers.
VS Code has strong support for web development, although it currently has weak support for mobile and desktop development.
VS Code is by far the most popular code editor or IDE across all developers, including non-.NET developers, with over 75% of professional developers selecting it in a Stack Overflow survey, which you can read at the following link: https://survey.stackoverflow.co/2025/technology/#1-dev-id-es.
GitHub Codespaces is a fully configured development environment, based on VS Code, that can be spun up in an environment hosted in the cloud and accessed through any web browser. It supports Git repos, extensions, and a built-in command-line interface, so you can edit, run, and test from any device.
But note that for your GitHub Codespaces experience to be fully functional and practically useful, it does have a license cost.
You can learn more about GitHub Codespaces at the following link: https://github.com/features/codespaces.
Visual Studio can create most types of applications, including console apps, websites, web services, and desktop apps. Although you can use Visual Studio on Windows to write a cross-platform mobile app that targets Android and iOS, you still need macOS and Xcode to compile it for iOS.
Warning! Visual Studio for Mac does not officially support .NET 8 or later, and it reached its end of life in August 2024. If you have been using Visual Studio for Mac, then you should switch to VS Code for Mac, Rider for Mac, or use Visual Studio for Windows in a virtual machine on your local computer or in the cloud, using a technology like Microsoft Dev Box. The retirement announcement can be read here: https://devblogs.microsoft.com/visualstudio/visual-studio-for-mac-retirement-announcement/.
Windows Subsystem for Linux (WSL) is one of the most powerful tools Microsoft has ever given to .NET developers doing cross-platform work. It lets you run a genuine Linux environment inside Windows without needing a VM or dual-boot setup. That means you can build, test, and debug Linux-targeted .NET applications directly from Windows, without leaving your main development environment like Visual Studio.
Even though you can write Linux-compatible .NET code on Windows, the actual runtime behavior may differ, for example, filesystem behavior, case sensitivity, permissions, path slashes, symlink support, and so on.
WSL lets you run your code natively on Linux, using the Linux kernel underneath. This is useful if you’re deploying to Linux servers (most modern .NET apps are hosted on Linux in production), and you want to test exactly how your app will behave in a Linux shell.
Let’s say you have a file-related feature that works fine on Windows, but Linux is case-sensitive. You can write unit tests or integration tests and run them in both environments. You’ll immediately see if something breaks on Linux. This is good for reducing “it works on my machine” problems and avoiding last-minute surprises when deploying to production Linux servers.
With WSL, you can use curl, grep, awk, sed, bash, and other Unix tools directly on your project and use package managers like apt to install dev tools and dependencies. If you’re serious about writing .NET software that runs on more than just Windows, you don’t have to give up your familiar Windows tools, and you get the real deal when it comes to testing and building for Linux.
You can learn how to install Linux on Windows with WSL at the following link: https://learn.microsoft.com/en-us/windows/wsl/install.
To write and test the code for this book, I used the following hardware and software:
Windows 11 on an HP Intel x64 laptop with Visual Studio, VS Code, and RidermacOS on an Apple Silicon Mac mini (M1) desktop with VS Code and RiderI hope that you have access to a variety of hardware and software, too, as seeing the differences in platforms deepens your understanding of development challenges, although any one of the above combinations is enough to learn the fundamentals of C# and .NET and how to build practical apps and websites.
Your choice of code editor and operating system for development does not limit where your code gets deployed.
.NET 10 supports the following platforms for deployment:
Windows: Windows 10 version 1607 or later, Windows 11 version 22000 or later, Windows Server 2012 R2 SP1 or later, and Nano Server version 2019 or laterLinux: Alpine Linux 3.22, Azure Linux 3.0, CentOS Stream 9 or 10, Debian 12 or 13, Fedora 42, openSUSE Leap 15.6, RHEL 9 or 10, SUSE Enterprise Linux 15.6, and Ubuntu 22.04, 24.04, or 25.04Android: API 21 or later is the minimum SDK target. Versions 12, 12.1, 13, 14, and 15iOS and iPadOS: 18. iOS 12.2 is used as the minimum SDK targetMac: macOS 14 or 15Windows Arm64 support in .NET 5 and later means you can develop on, and deploy to, Windows Arm devices like Microsoft’s Surface Pro 11 and Surface Laptop 7, and similar devices.
You can review the latest supported operating systems and versions at the following link: https://github.com/dotnet/core/blob/main/release-notes/10.0/supported-os.md.
All versions of .NET that are supported can be automatically patched via Microsoft Update on Windows.
Many professional .NET developers use Visual Studio in their day-to-day development work. Even if you choose to use VS Code to complete the coding tasks in this book, you might want to familiarize yourself with Visual Studio too. It is not until you have written a decent amount of code with a tool that you can really judge if it fits your needs.
Since October 2014, Microsoft has made a professional-quality edition of Visual Studio available to students, open source contributors, and individuals for free. It is called Community Edition. Any of the editions are suitable for this book. If you have not already installed it, let’s do so now:
Download the latest version of Visual Studio from the following link: https://visualstudio.microsoft.com/downloads/.At the time of publishing in November 2025, the latest version of Visual Studio is version 18.0, and it is branded as Visual Studio 2026. If you choose to do so, you should be able to use Visual Studio 2022 to complete this book, although the user interface might move things around a bit.
In this book, I will avoid showing keyboard shortcuts, since they are often customized. Where they are consistent across code editors and commonly used, I will try to show them.
If you want to identify and customize your keyboard shortcuts, then you can, as shown at the following link: https://learn.microsoft.com/en-us/visualstudio/ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio.
VS Code has rapidly improved over the past couple of years and has pleasantly surprised Microsoft with its popularity. If you are brave and like to live on the bleeding edge, then there is the Insiders edition, which is a daily build of the next version.
Even if you plan to only use Visual Studio for development, I recommend that you download and install VS Code and try the coding tasks in this chapter using it, and then decide if you want to stick with just using Visual Studio for the rest of the book.
Let’s now download and install VS Code, the .NET SDK, and the C# Dev Kit extension:
Download and install either the Stable build or the Insiders edition of VS Code from the following link: https://code.visualstudio.com/.If you need more help installing VS Code, you can read the official setup guide at the following link: https://code.visualstudio.com/docs/setup/setup-overview.
In real life, you are extremely likely to have more than one .NET SDK version installed on your computer. To learn how to control which .NET SDK version is used to build a project, we need multiple versions installed. .NET 8, .NET 9, and .NET 10 will be the only supported versions during the year after publishing in November 2025. You can safely install multiple SDKs side by side. The most recent SDK will be used to build your projects.
Good practice: Be sure to read the license agreement for the C# Dev Kit. It has a more restrictive license than the C# extension: https://aka.ms/vs/csdevkit/license.
In later chapters of this book, you will use more VS Code extensions. If you want to install them now, all the extensions that we will use are shown in Table 1.1:
Extension name and identifier
Description
C# Dev Kit
ms-dotnettools.csdevkit
Official C# extension from Microsoft. Helps you manage your code with a solution explorer and test your code with integrated unit test discovery and execution, elevating your C# development experience wherever you like to develop (Windows, macOS, Linux, and even in a codespace).
C#
ms-dotnettools.csharp
Provides rich language support for C# and is shipped along with the C# Dev Kit. Powered by an LSP server, this extension integrates with open source components like Roslyn and Razor to provide rich type information and a faster, more reliable C# experience.
IntelliCode for C# Dev Kit
ms-dotnettools.vscodeintellicode-csharp
Provides AI-assisted development features for Python, TypeScript/JavaScript, C#, and Java developers.
MSBuild project tools
tintoy.msbuild-project-tools
Provides IntelliSense for MSBuild project files, including autocomplete for <PackageReference> elements.
Markdown All in One
yzhang.markdown-all-in-one
All you need for Markdown (keyboard shortcuts, table of contents, auto preview, and more).
Polyglot Notebooks
ms-dotnettools.dotnet-interactive-vscode
Adds support for using .NET and other languages in a notebook. It has a dependency on the Jupyter extension (ms-toolsai.jupyter), which itself has dependencies.
ilspy-vscode
icsharpcode.ilspy-vscode
Decompiles MSIL assemblies – support for modern .NET, .NET Framework, .NET Core, and .NET Standard.
REST Client
humao.rest-client
Send an HTTP request and view the response directly in VS Code.
Table 1.1: VS Code extensions for .NET development
You can install a VS Code extension at the command prompt or terminal, as shown in Table 1.2:
Command
Description
code --list-extensions
List installed extensions
code --install-extension <extension-id>
Install the specified extension
code --uninstall-extension <extension-id>
Uninstall the specified extension
Table 1.2: Managing VS Code extensions at the command prompt
For example, to install the C# Dev Kit extension, enter the following at the command prompt:
code --install-extension ms-dotnettools.csdevkitI have created PowerShell scripts to install and uninstall the VS Code extensions in the preceding table. You can find them at the following link: https://github.com/markjprice/cs14net10/tree/main/scripts/extension-scripts/. PowerShell scripts are cross-platform, as you can read about at the following link: https://learn.microsoft.com/en-us/powershell/scripting/overview.
Microsoft releases a new feature version of VS Code (almost) every month and bug-fix versions more frequently. For example:
Version 1.104.0, August 2025 feature releaseVersion 1.104.1, August 2025 bug fix releaseThe version used in this book is 1.104.0, the August 2025 feature release, but the version of VS Code is less important than the version of the C# Dev Kit or C# extension that you install. I recommend C# Dev Kit v1.50.51 or later with C# extension v2.91.30 or later.
While the C# extension is not required, it provides IntelliSense as you type, code navigation, and debugging features, so it’s something that’s very handy to install and keep updated to support the latest C# language features.
If you want to customize your keyboard shortcuts for VS Code, then you can, as shown at the following link: https://code.visualstudio.com/docs/getstarted/keybindings.
I recommend that you download a PDF of VS Code keyboard shortcuts for your operating system from the following list:
Windows: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdfmacOS: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-macos.pdfLinux: https://code.visualstudio.com/shortcuts/keyboard-shortcuts-linux.pdfNow that you have set up your development environment, let’s review some key information about .NET.
“Those who cannot remember the past are condemned to repeat it.”
– George Santayana
.NET, .NET Core, .NET Framework, .NET Standard, and Xamarin are related and overlapping platforms for developers used to build applications and services.
If you are not familiar with the history of .NET, then I will introduce you to each of these .NET concepts at the following link:
https://github.com/markjprice/cs14net10/blob/main/docs/ch01-dotnet-history.md.
As time moves on, more and more readers already know the history of .NET, so it would be a waste of space in the book to continue to include it. But if you are new to it, then make sure you read all the extras that I provide online, like the preceding one.
.NET versions are either Long-Term Support (LTS), Standard-Term Support (STS) (formerly known as Current), or Preview, as described in the following list:
LTS releases are supported by Microsoft for 3 years after General Availability (GA), or 1 year after the next LTS release ships, whichever is longer.STS releases are supported by Microsoft for 2 years after GA, or 1 year after the next STS or LTS release ships, whichever is longer.Preview releases are for public testing. These should only be used by adventurous programmers who want to live on the bleeding edge, or programming book authors who need to have early access to new language features, libraries, and app and service platforms. Preview releases are not usually supported by Microsoft, but some preview or Release Candidate (RC) releases may be declared Go Live, meaning they are supported by Microsoft in production. But you must migrate to the final release as soon as it is available.STS and LTS releases receive critical patches throughout their lifetime for security and reliability.
There is no difference in quality between an LTS and an STS release. LTS releases do not have fewer bugs than STS releases. The teams plan what features they want to add, implement them, and release them. STS releases are no more likely to include experimental features than LTS releases. Literally the only difference between LTS and STS releases is how long Microsoft promises to support the release. In September 2025, Microsoft announced that STS support would be extended from 18 months to 24 months. You can read about this at the following link: https://devblogs.microsoft.com/dotnet/dotnet-sts-releases-supported-for-24-months/.
Good practice: You must stay up to date with the latest patches to get support. For example, if a system is running on .NET Runtime version 10.0.0 and then version 10.0.1 is released, you must install version 10.0.1 to get support. These updates are released on the second Tuesday of each month, aka Patch Tuesday.
To better understand your choices of STS and LTS releases, it is helpful to see their support durations visualized, with 3-year-long black bars for LTS releases, and 2-year-long gray bars for STS releases, as shown in Figure 1.3:
Figure 1.3: Support durations for recent and planned STS and LTS releases
During the lifetime of .NET 10, .NET 8 and .NET 9 will still be supported (for a while), and .NET 11 and .NET 12 will be released. I have tried to be cognizant that you might choose to use future versions like .NET 11 or .NET 12 with this book; however, obviously, the book cannot cover those new features, since I don’t know what they will be!
If you have existing .NET 8 and .NET 9 projects, then you should start work on migrating them to .NET 10 as soon as possible.
If you need LTS from Microsoft, then set your new .NET projects to target .NET 10 today and then migrate to .NET 12 after it is released in November 2027. This is because .NET 11 will be an STS release, and therefore, it will lose support in November 2028, on the same day that .NET 10 reaches its end-of-life. As soon as .NET 12 is released, start upgrading your .NET 10 projects to it. You will have a year to do so before .NET 10 and .NET 11 reach their end-of-life date.
Good practice: Remember that with all releases, you must upgrade to bug-fix releases like .NET Runtime 10.0.1 and .NET SDK 10.0.101, which are expected to be released in December 2025, as updates are released every month.
The lifetime of a version of .NET passes through several phases, during which they have varying levels of support, as described in the following list and as shown in Figure 1.4:
Preview: These are not supported at all. .NET 10 Preview 1 to Preview 7 were in this support phase from February 2025 to August 2025.Go Live: These are supported until GA, and then they become immediately unsupported. You must upgrade to the final release version as soon as it is available. .NET 10 Release Candidate 1 and Release Candidate 2 were in this support phase in September and October 2025, respectively.Active: .NET 10 will be in this support phase from November 2025 to May 2028. Monthly releases include bug fixes and security fixes. You must update to any patch version release every month to have support.Maintenance: Supported only with security fixes for the last six months of its lifetime. .NET 10 will be in this support phase from May 2028 to November 2028. In May 2026, .NET 8 and .NET 9 enter their maintenance phase. If you have existing projects that target .NET 8 or .NET 9, then you should migrate those projects to .NET 10 because it could take up to six months to do so for a large project.EOL: Not supported. .NET 10 will reach its EOL in November 2028.Figure 1.4: .NET 10 support phases from preview to maintenance
End of support or end of life (EOL) means the date after which bug fixes, security updates, or technical assistance are no longer available from Microsoft.
At the time of publishing in November 2025, all versions of modern .NET have reached their EOL, except those shown in the following list:
.NET 8 is in its active phase. It will enter its maintenance phase in May 2026, and it will reach its EOL in November 2026..NET 9 is in its active phase. It will enter its maintenance phase in May 2026, and it will reach EOL in November 2026..NET 10 will be in its active phase until May 2028, then it will be in its maintenance phase until it reaches EOL in November 2028..NET 11 will be in its preview phase from February 2026 to early November 2026. It will be active from November 2026 to May 2028, and it will reach EOL in November 2028..NET 12 will be available in preview from February 2027, then be active from November 2027, and it will reach EOL in November 2030.You can check which .NET versions are currently supported and when they will reach EOL at the following link: https://github.com/dotnet/core/blob/main/releases.md.
When .NET 8 and .NET 9 reach their end of support in November 2026, you can expect the following:
Projects that use .NET 8 or .NET 9 will continue to runNo new security updates will be issued for .NET 8 or .NET 9, and therefore, continuing to use an unsupported version will increasingly expose you to security vulnerabilitiesYou might not be able to access technical support for any .NET 8 or .NET 9 applications that you continue to useYou will get NETSDK1138 build warnings when targeting .NET 8 or .NET 9 from recent SDKs like the .NET 10 SDKYou will get warnings in Visual Studio when targeting .NET 8 or .NET 9If you have not built a standalone app, then the .NET Runtime is the minimum you need to install so that an operating system can run a .NET application. The .NET SDK includes the .NET Runtime, as well as the compilers and other tools needed to build .NET code and apps.
.NET Runtime versioning follows semantic versioning, that is, a major increment indicates breaking changes, minor increments indicate new features, and patch increments indicate bug fixes.
.NET SDK versioning does not follow semantic versioning. The major and minor version numbers are tied to the runtime version they are matched with. The third number follows a convention that indicates the minor and patch versions of the SDK. The third number starts at 100 for the initial version (equivalent to 0.0 for the minor and patch numbers). The first digit increments with minor increments, and the other two digits increment with patch increments.
You can see an example of this in Table 1.3:
Change
.NET Runtime
.NET SDK
Initial release
10.0.0
10.0.100
SDK bug fix
10.0.0
10.0.101
Runtime and SDK bug fix
10.0.1
10.0.102
SDK new feature
10.0.1
10.0.200
Table 1.3: Examples of changes and versions for a .NET Runtime and .NET SDK
All future versions of the .NET 10 runtime are compatible with its major version. For example, if a project targets net10.0, then you can upgrade the .NET Runtime to future versions like 10.0.1, 10.0.2, and so on. In fact, you must upgrade the .NET Runtime every month to maintain support.
All future versions of the .NET SDK maintain the ability to build projects that target previous versions of the runtime. For example, if a project targets net10.0 and you initially build it using .NET SDK 10.0.100, then you can upgrade the .NET SDK to future bug-fix versions, like 10.0.101, or a major version, like 11.0.100, and that SDK can still build the project for the older targeted version. This means that you can safely remove all older versions of any .NET SDKs, like 8.0.100, 9.0.100, or 10.0.100, after you’ve installed a .NET SDK 11 or later. You will still be able to build all your old projects that target those older versions.
You can see which SDKs and runtimes are currently installed using the following commands:
dotnet --list-sdks dotnet --list-runtimes dotnet --infoGood practice: To make it easier to enter commands at the command prompt or terminal, the following link lists all commands throughout the book that can be easily copied and pasted: https://github.com/markjprice/cs14net10/blob/main/docs/command-lines.md.
On Windows, use the Apps & features section to remove .NET SDKs.
On Linux, there i
