Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Apps and Services with .NET 10
  • Table Of Contents Toc
Apps and Services with .NET 10

Apps and Services with .NET 10 - Third Edition

By : Mark J. Price
5 (3)
close
close
Apps and Services with .NET 10

Apps and Services with .NET 10

5 (3)
By: Mark J. Price

Overview of this book

Building modern apps and services with C# and .NET isn’t just about knowing the syntax—it’s about knowing the right tools for the job. Whether you’re building for web, desktop, or mobile, the .NET ecosystem offers a vast range of technologies. But with so many choices, it’s easy to get stuck in a narrow skillset. Apps and Services with .NET 10 helps you build real-world experience across the breadth of what .NET has to offer. This edition covers practical implementations across a diverse set of technologies. You'll build APIs with ASP.NET Core Minimal API, gRPC, GraphQL, and SignalR, and create user-facing applications using Blazor for the web, Avalonia for desktop, and .NET MAUI for mobile. You’ll also explore native AOT (Ahead-of-Time) compilation for high-performance web services, along with caching, messaging, and long-running background tasks. Each chapter provides hands-on projects and real-world context for when and why to use each tool. By the end, you’ll have a full-stack command of modern .NET. You’ll know how to select the right UI tech for your target platform, build APIs that scale, architect reliable backend services, and confidently adopt newer patterns. You won’t just understand the tools—you’ll know how to put them together to deliver robust, user-friendly, cross-platform apps in production environments. *Email sign-up and proof of purchase required
Table of Contents (18 chapters)
close
close
17
Index

Setting up your development environment

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:

  • Visual Studio for Windows
  • VS Code for Windows, Mac, or Linux
  • VS Code for the Web or GitHub Codespaces

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.

Choosing the appropriate tool and application type for learning

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.

Using Visual Studio for general development

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/.

Using VS Code for cross-platform development

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.

What I used

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 Rider.
  • macOS on an Apple Silicon Mac mini (M1) desktop with VS Code and Rider.

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.

Rider and its warnings about boxing

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.

Deploying cross-platform

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 later.
  • Linux: 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.04.
  • Android: API 21 or later is the minimum SDK target. Versions 12, 12.1, 13, 14, and 15.
  • iOS and iPadOS: 18. iOS 12.2 is used as the minimum SDK target.
  • Mac: macOS 14 or 15.

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.

Downloading and installing Visual Studio

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:

  1. Download the latest version of Visual Studio from the following link: https://visualstudio.microsoft.com/downloads/.

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.

  1. Start the installer.
  2. On the Workloads tab, select the following:
    • ASP.NET and web development
    • Azure development
    • .NET Multi-platform App UI development
    • .NET desktop development (because this includes console apps)
    • Desktop development with C++ with all default components (because this enables publishing console apps and web services that start faster and have smaller memory footprints)
  3. On the Individual components tab, in the Code tools section, select Git for Windows.
  4. Click Install and wait for the installer to acquire the selected software and install it.
  5. When the installation is complete, click Launch.
  6. The first time that you run Visual Studio, you will be prompted to sign in. If you have a Microsoft account, you can use that account. If you don’t, then register for a new one at the following link: https://signup.live.com/.
  7. The first time that you run Visual Studio, you will be prompted to configure your environment. For Development Settings, choose Visual C#. For the color theme, I chose Light, but you can choose whatever tickles your fancy.
  8. If you want to customize your keyboard shortcuts, navigate to Tools | Options…, and then select the Environment | Keyboard option.

Visual Studio keyboard shortcuts

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.

Downloading and installing VS Code

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:

  1. 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 on any operating system, you can read the official setup guide at the following link: https://code.visualstudio.com/docs/setup/setup-overview.

  1. Download and install the .NET SDK for version 10.0 from the following link: https://www.microsoft.com/net/download.
  2. To install the C# Dev Kit extension using the user interface, you must first launch the VS Code application.
  3. In VS Code, click the Extensions icon or navigate to View | Extensions.
  4. C# Dev Kit is one of the most popular extensions available, so you should see it at the top of the list, or you can enter 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.

  1. Click Install and wait for the supporting packages to download and install.

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.

Installing other extensions

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

ms-dotnettools.csdevkit

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#

ms-dotnettools.csharp

C# editing support, including syntax highlighting, IntelliSense, Go To Definition, Find All References, debugging support for .NET, and support for csproj projects on Windows, macOS, and Linux.

GitHub Copilot Chat

github.copilot-chat

GitHub Copilot is an AI peer programming tool that helps you write code faster and smarter.

MSBuild project tools

tintoy.msbuild-project-tools

Provides IntelliSense for MSBuild project files, including autocomplete for <PackageReference> elements.

SQL Server (mssql) for VS Code

ms-mssql.mssql

For developing SQL Server, Azure SQL Database, and SQL data warehouses everywhere with a rich set of functionalities.

REST Client

humao.rest-client

Send an HTTP request and view the response directly in VS Code.

ilspy-vscode

icsharpcode.ilspy-vscode

Decompile MSIL assemblies – support for modern .NET, .NET Framework, .NET Core, and .NET Standard.

Protobuf VSC

drblury.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

Managing VS Code extensions at the command prompt

You can install a VS Code extension at the command prompt or terminal, as shown in Table 1.6:

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.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.

Understanding VS Code versions

Microsoft releases a new feature version of VS Code (almost) every month and bug-fix versions more frequently. For example:

  • Version 1.107.0, November 2025 feature release
  • Version 1.107.1, November 2025 bug fix release

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.

VS Code keyboard shortcuts

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:

Using other project templates

When you install the .NET SDK, there are many project templates included. Let’s review them:

  1. At a command prompt or terminal, enter the following command:
    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.

  1. You will see a list of currently installed templates, including templates for Windows desktop development if you are running on Windows, the most common of which are shown in Table 1.7:

Template Name

Short Name

Language

.NET MAUI App

maui

C#

.NET MAUI Blazor App

maui-blazor

C#

ASP.NET Core Empty

web

C#, F#

ASP.NET Core gRPC Service

grpc

C#

ASP.NET Core Web API

webapi

C#, F#

ASP.NET Core Web API (native AOT)

webapiaot

C#

ASP.NET Core Web App (Model-View-Controller)

mvc

C#, F#

Blazor Web App

blazor

C#

Class Library

classlib

C#, F#, VB

Console App

console

C#, F#, VB

EditorConfig File

editorconfig

global.json File

globaljson

Solution File

sln

xUnit Test Project

xunit

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/.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Apps and Services with .NET 10
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon