![](/user_photo/_userpic.png)
- •Table of Contents
- •About the Author
- •Acknowledgments
- •Introduction
- •Version Support
- •Supported Versions
- •A Unified Platform
- •Roadmap
- •Supported Operating Systems
- •Command Line Interface
- •Desktop Development
- •Blazor
- •MAUI
- •Wrapping Up
- •.NET 6 Architecture
- •Runtimes
- •CoreCLR
- •Mono
- •WinRT
- •Managed Execution Process
- •Desktop Packs
- •Wrapping Up
- •Dotnet New
- •Dotnet Restore
- •NuGet.config
- •Dotnet Build
- •Dotnet Publish
- •Dotnet Run
- •Dotnet Test
- •Using the CLI in GitHub Actions
- •Other Commands
- •Wrapping Up
- •WinAPI
- •WinForms
- •STAThread
- •WinForms Startup
- •DPI Mode
- •Responding to Scale Events
- •Visual Styles
- •Text Rendering
- •The Message Loop
- •The Form Designer
- •WPF Startup
- •XAML Layout
- •Visual Tree
- •Data Binding
- •Windows App SDK
- •Building a Windows App SDK application
- •Using Windows APIs with Windows App SDK
- •Packaging
- •Migrating to .NET 6
- •Upgrade Assistant
- •Wrapping Up
- •Blazor WebAssembly
- •Creating a Blazor Wasm Project
- •Blazor Progressive Web Apps
- •Exploring the Blazor Client Project
- •Blazor in .NET 6
- •Blazor Component System
- •Creating Blazor Pages
- •Running a Blazor App
- •Blazor Server
- •SignalR
- •Blazor Desktop
- •Wrapping Up
- •Project Structure
- •Exploring MAUI
- •The Cross-Platform World
- •Application Lifecycle
- •MVVM
- •MVVM Toolkit
- •Wrapping Up
- •Model-View-Controller
- •Routing
- •Views
- •Controllers
- •Controller-Based APIs
- •Minimal APIs
- •Wrapping Up
- •Web Apps
- •Creating an App Service
- •Static Web Apps
- •Web App for Containers
- •Docker
- •Azure Functions
- •Deploying Azure Functions
- •Wrapping Up
- •Record Types
- •Monolith Architecture
- •Microservices
- •Container Orchestration
- •Kubernetes
- •Docker Compose
- •Dapr
- •Installing Dapr
- •Dapr State Management
- •Wrapping Up
- •Roslyn
- •Compiler API
- •Diagnostic API
- •Scripting API
- •Workspace API
- •Syntax Tree
- •Roslyn SDK
- •Source Generators
- •Writing a Source Generator
- •Debugging Source Generators
- •Wrapping Up
- •Garbage Collector
- •The Heap
- •The Stack
- •Garbage Collection
- •A Look at the Threadpool
- •Async in .NET 6
- •Await/Async
- •Cancellations
- •WaitAsync
- •Conclusion
- •Index
Chapter 11 Advanced .NET 6
Do not mistake WaitAsync with Wait. Wait is an actual blocking operation; it will block the thread until the Tasks completes and should only be used in very specific cases. WaitAsync is a way to add cancellation or timeout configuration to an asynchronous task that will run non-blocking.
Conclusion
.NET is an easy-to-use framework. It abstracts a lot of difficult concepts away from us as developers. While it does abstract these concepts away, we still have the possibility to dive deeper and actually use the more advanced concepts. We can get full control of the garbage collector and even implement our own garbage collectors should we really want to.
.NET 6 comes with big improvements on performance, on I/O-based operations, but also in general. Await/async is extended to give more fine-grained control to us developers; CancellationTokenSource is extended to allow more reuse of tokens. The examples in this chapter are just a few examples. There are some very good resources out there that dive deep into .NET.
•\ |
Async/Await - Best Practices in Asynchronous Programming - |
|
https://docs.microsoft.com/en-us/archive/msdn-magazine/ |
|
2013/march/async-await-best-practices-in-asynchronous- |
|
programming |
•\ |
Pro .NET Memory Management - https://link.springer.com/ |
|
book/10.1007/978-1-4842-4027-4 |
•\ |
Task Parallel Library (TPL) - https://docs.microsoft.com/ |
|
en-us/dotnet/standard/parallel-programming/task-parallel- |
|
library-tpl |
311