Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals
C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals

C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals: Build modern websites and services with ASP.NET Core, Blazor, and EF Core using Visual Studio 2026 , Tenth Edition

eBook
Mex$812.69 Mex$902.99
Paperback
Mex$1128.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

C# 14 and .NET 10 – Modern Cross-Platform Development Fundamentals

Summary

In this chapter, we did the following:

  • Set up your development environment.
  • Used Visual Studio and VS Code with the .NET SDK CLI to create a couple of simple console apps, grouped in a solution.
  • Learned how to download the solution code for this book from its GitHub repository.
  • Learned how to find help. This could be in the traditional way, by using help command switches, documentation, and articles, or the modern way, by having a conversation with a coding expert AI or using an AI-based tool to perform “grunt work.”

In the next chapter, you will learn how to “speak” C#.

Learn more on Discord

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

Leave a review!

Thank you for purchasing this book from Packt Publishing – we hope you enjoy it! Your feedback is invaluable and helps us improve and grow. Once you’ve completed reading it, please take a moment to leave an Amazon review; it will only take a minute, but it makes a big difference for readers like you.Scan the QR or visit the link to receive a free e-book of your choice:https://packt.link/NzOWQ

A qr code with black squares Description automatically generated

Understanding C# grammar and vocabulary

Let’s start by looking at the basics of the grammar and vocabulary of C#. Throughout this chapter, you will create multiple console apps, with each one showing related features of the C# language.

The grammar of C# includes statements and blocks. To document your code, you can use comments.

Statements

In English, we indicate the end of a sentence with a period. A sentence can be composed of multiple words and phrases, with the order of words being part of the grammar. For example, in English, we say “the black cat.”

The adjective, black, comes before the noun, cat. However, French grammar has a different order; the adjective comes after the noun: “le chat noir.” What’s important to take away from this is that the order matters.

C# indicates the end of a statement with a semicolon. A statement can be composed of multiple types, variables, and expressions made up of tokens. Each token...

Working with variables

All applications process data. Data comes in, data is processed, and then data goes out.

Data usually comes into our program from files, databases, or user input, and it can be put temporarily into variables, which will be stored in the memory of the running program. When the program ends, the data in memory is lost. Data is usually output to files and databases, or to the screen or a printer. When using variables, you should think about, firstly, how much space the variable takes up in the memory, and, secondly, how fast it can be processed.

We control this by picking an appropriate type. You can think of simple common types, such as int and double, as being different-sized storage boxes, where a smaller box would take less memory but may not be as fast at being processed; for example, adding 16-bit numbers might not be processed as quickly as adding 64-bit numbers on a 64-bit operating system. Some of these boxes may be stacked close by, and some may...

Exploring more about console apps

Console apps are text-based and are run at the command prompt. They typically perform simple tasks that need to be scripted, such as compiling a file or encrypting a section of a configuration file. Equally, they can also have arguments passed to them to control their behavior.

An example of this would be to create a new console app using the F# language with a specified name instead of using the name of the current folder, as shown in the following command:

dotnet new console -lang "F#" --name "ExploringConsole"

Displaying output to the user

The two most common tasks that a console app performs are writing and reading data. We have already used the WriteLine method to output, but if we didn’t want a carriage return at the end of a line, for example, if we later wanted to continue to write more text at the end of that line, we could have used the Write method.

If you want to write three letters to the...

Practicing and exploring

Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring the topics covered in this chapter with deeper research.

All exercises in all Practicing and exploring sections at the end of each chapter are optional. You do not have to complete them to continue with the rest of the book.

Exercise 2.1 – Online material

Online materials can be extra content written by me for this book, or they can be references to content created by Microsoft or third parties.

Handling platforms that do not support an API

Learn about three techniques to handle platforms that do not support an API at the following link: https://github.com/markjprice/cs14net10/blob/main/docs/ch02-api-unsupported-platforms.md.

Explore Spectre and other console app enhancement packages

No, not the villainous organization from the James Bond films! Spectre is a package that enhances console apps. You can...

Summary

In this chapter, you learned how to do the following:

  • Declare variables with a specified or inferred type
  • Use some of the built-in types for numbers, text, and Booleans
  • Choose between number types
  • Control output formatting in console apps

In the next chapter, you will learn about operators, branching, looping, converting between types, and how to handle exceptions.

Get This Book’s PDF Version and Exclusive Extras’

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.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore the newest additions to the C# language, the .NET class libraries, and data modeling with Entity Framework Core
  • Build professional modern websites and services with ASP.NET Core, Blazor, and Minimal API services
  • Enhance your skills with step-by-step code examples and good practice tips

Description

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.

Who is this book for?

This book is for beginner-to-intermediate level C# and .NET developers. While prior experience with C# or .NET is not a prerequisite, a general understanding of programming concepts will be helpful. To learn about technologies for building modern .NET projects such as gRPC, SignalR, and GraphQL for services, or Avalonia, Blazor, and .NET MAUI for apps, read Mark's Apps and Services with .NET 10. For more mature web development technologies like ASP.NET Core MVC, controller-based Web API services, OData services, and Umbraco CMS, check out Mark's Real-World Web Development with .NET 10.

What you will learn

  • Discover the new features in .NET 10, including the NumericOrdering option and OrderedDictionary enhancements
  • Leverage the latest ASP.NET Core 10 features, such as OpenAPI 3.1 document generation, YAML format support, and populating XML doc comments
  • Use native AOT publishing for faster startup and reduced memory footprint
  • Build rich web user interface experiences with Blazor
  • Integrate databases into your applications using EF Core 10 entity models
  • Query and manipulate data using LINQ
  • Develop powerful web services with Minimal APIs

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 11, 2025
Length: 828 pages
Edition : 10th
Language : English
ISBN-13 : 9781836206620
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Nov 11, 2025
Length: 828 pages
Edition : 10th
Language : English
ISBN-13 : 9781836206620
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Table of Contents

18 Chapters
Hello, C#! Welcome, .NET! Chevron down icon Chevron up icon
Speaking C# Chevron down icon Chevron up icon
Controlling Flow, Converting Types, and Handling Exceptions Chevron down icon Chevron up icon
Writing, Debugging, and Testing Functions Chevron down icon Chevron up icon
Building Your Own Types with Object-Oriented Programming Chevron down icon Chevron up icon
Implementing Interfaces and Inheriting Classes Chevron down icon Chevron up icon
Packaging and Distributing .NET Types Chevron down icon Chevron up icon
Working with Common .NET Types Chevron down icon Chevron up icon
Working with Files, Streams, and Serialization Chevron down icon Chevron up icon
Working with Data Using Entity Framework Core Chevron down icon Chevron up icon
Querying and Manipulating Data Using LINQ Chevron down icon Chevron up icon
Introducing Modern Web Development Using .NET Chevron down icon Chevron up icon
Building Websites Using ASP.NET Core Chevron down icon Chevron up icon
Building Interactive Web Components Using Blazor Chevron down icon Chevron up icon
Building and Consuming Web Services Chevron down icon Chevron up icon
Unlock Your Exclusive Benefits Chevron down icon Chevron up icon
Epilogue Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Giuseppe Nov 13, 2025
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book! A must for every .NET developer!
Subscriber review Packt
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.

Modal Close icon
Modal Close icon