-
Book Overview & Buying
-
Table Of Contents
Apps and Services with .NET 10 - Third Edition
By :
Before you start programming, you’ll need a code editor for C#. Microsoft has a family of code editors and Integrated Development Environments (IDEs), which include:
Third parties have created their own C# code editors, for example, Rider, which is available for Windows, Mac, or Linux, but does have a license cost. Rider is popular with more experienced .NET developers.
What is the best tool and application type for building apps and services with C# and .NET?
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, or even Rider.
In this book, I give general instructions that work with all tools, so you can use whichever tool you prefer.
Visual Studio can create most types of applications, including console apps, websites, web services, desktop, and mobile apps.
Although you can use Visual Studio with a .NET MAUI project to write a cross-platform mobile app, you still need macOS and Xcode to compile it.
Visual Studio only runs on Windows 10 version 1909 or later, or Windows Server 2016 or later, and only on 64-bit versions. Version 17.4 is the first version to support native Arm64.
Warning! Visual Studio for Mac does not officially support .NET 8 or later, and it reached 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/.
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#.
Being cross-platform and lightweight, it 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 has strong support for web development, although it currently has weak support for mobile and desktop development.
VS Code is supported on ARM processors, so you can develop on Apple Silicon computers and Raspberry Pi.
VS Code is by far the most popular integrated development environment, with over 75% of professional developers selecting it in the Stack Overflow 2025 survey, which you can read at the following link: https://survey.stackoverflow.co/2025/technology/#1-dev-id-es.
To write and test the code for this book, I used the following hardware and software:
I hope that you have access to a variety of hardware and software, too because seeing the differences on various platforms deepens your understanding of development challenges, although any one of the above combinations is enough to learn how to build practical apps and websites.
Getting Started: Chapter 1 of the C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals book has online sections showing how to get started with multiple projects using various code editors like Visual Studio, VS Code, or Rider. You can read the sections at the following link: https://github.com/markjprice/cs14net10/blob/main/docs/code-editors/README.md.
If you use Rider and you have installed the Unity Support plugin, then it will complain a lot about boxing. A common scenario when boxing happens is when value types like int and DateTime are passed as positional arguments to string formats. This is a problem for Unity projects because they use a different memory garbage collector than the normal .NET runtime. For non-Unity projects, like all the projects in this book, you can ignore these boxing warnings because they are not relevant. You can read more about this Unity-specific issue at the following link: https://docs.unity3d.com/Manual/performance-garbage-collection-best-practices.html#boxing.
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 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.
Many professional Microsoft 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.
If you do not have a Windows computer, then you can skip this section and continue to the next section where you will download and install VS Code on macOS or Linux.
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:
At the time of publishing in February 2026, the latest version of Visual Studio is version 18.2 and it is branded as Visual Studio 2026. If you choose to do so, you should be able to use Visual Studio 2022 version 17.14 or later 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:
If you need more help installing VS Code on any operating system, you can read the official setup guide at the following link: https://code.visualstudio.com/docs/setup/setup-overview.
C# Dev Kit in the search box.C# Dev Kit has a dependency on the C# extension version 2.0 or later, so you do not have to install the C# extension separately. Note that C# extension version 2.0 or later no longer uses OmniSharp since it has a new Language Service Protocol (LSP) host. C# Dev Kit also has dependencies on the .NET Install Tool for Extension Authors and IntelliCode for C# Dev Kit extensions so they will be installed too.
Good practice: Be sure to read the license agreement for 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.5:
|
Extension name and identifier |
Description |
|
C# Dev Kit
|
Official C# extension from Microsoft. Manage your code with a solution explorer and test your code with integrated unit test discovery and execution. Includes the C# extension. |
|
C#
|
C# editing support, including syntax highlighting, IntelliSense, Go To Definition, Find All References, debugging support for .NET, and support for |
|
GitHub Copilot Chat
|
GitHub Copilot is an AI peer programming tool that helps you write code faster and smarter. |
|
MSBuild project tools
|
Provides IntelliSense for MSBuild project files, including autocomplete for |
|
SQL Server (mssql) for VS Code
|
For developing SQL Server, Azure SQL Database, and SQL data warehouses everywhere with a rich set of functionalities. |
|
REST Client
|
Send an HTTP request and view the response directly in VS Code. |
|
ilspy-vscode
|
Decompile MSIL assemblies – support for modern .NET, .NET Framework, .NET Core, and .NET Standard. |
|
Protobuf VSC
|
Full Protocol Buffers language support for VS Code: navigation, IntelliSense, diagnostics, formatting, compilation, linting, breaking-change checks, and schema graphs. |
Table 1.5: VS Code extensions used in this book
You can install a VS Code extension at the command prompt or terminal, as shown in Table 1.6:
|
Command |
Description |
|
|
List installed extensions. |
|
|
Install the specified extension. |
|
|
Uninstall the specified extension. |
Table 1.6: Working with 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.csdevkit
I 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/apps-services-net10/tree/main/scripts/extension-scripts.
Microsoft releases a new feature version of VS Code (almost) every month and bug-fix versions more frequently. For example:
The version used in this book is 1.108.2, the December 2025 bug fix release, but the version of Microsoft 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.90.2 or later with C# extension v2.112.45 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.
In this book, I will avoid showing keyboard shortcuts used for tasks like creating a new file since they are often different on different operating systems. The situations where I will show keyboard shortcuts are when you need to repeatedly press the key, for example, while debugging. These are also more likely to be consistent across operating systems.
If you want to customize your keyboard shortcuts for VS Code, you can do so, as shown at the following link: https://code.visualstudio.com/docs/getstarted/keybindings.
I recommend that you download a PDF of keyboard shortcuts for your operating system from the following list:
When you install the .NET SDK, there are many project templates included. Let’s review them:
dotnet new list
.NET 7 and later SDKs support either dotnet new --list or dotnet new list. The .NET 6 and earlier SDKs only support dotnet new --list.
|
Template Name |
Short Name |
Language |
|
.NET MAUI App |
|
C# |
|
.NET MAUI Blazor App |
|
C# |
|
ASP.NET Core Empty |
|
C#, F# |
|
ASP.NET Core gRPC Service |
|
C# |
|
ASP.NET Core Web API |
|
C#, F# |
|
ASP.NET Core Web API (native AOT) |
|
C# |
|
ASP.NET Core Web App (Model-View-Controller) |
|
C#, F# |
|
Blazor Web App |
|
C# |
|
Class Library |
|
C#, F#, VB |
|
Console App |
|
C#, F#, VB |
|
|
|
|
|
|
|
|
|
Solution File |
|
|
|
xUnit Test Project |
|
Table 1.7: Project template full and short names
.NET MAUI projects are not supported for Linux. The team has said they have left that work to the open-source community. If you need to create a truly cross-platform graphical app, then take a look at Avalonia at the following link: https://avaloniaui.net/.
Change the font size
Change margin width
Change background colour