Categories
.NET .NET 10 ASP.NET Core Aspire Automation Azure Blazor C# CLI Code Desktop Developer Getting Started Linux macOS Mobile Visual Studio VS Code Web What's New Windows

Using C# Ignored Directives: A Guide for Programmers

C# – Preprocessor Directives are highly useful for writing code that can be compiled conditionally, depending on factors like the target framework, target platform, or build configuration.

For example:

#if NET9_0_OR_GREATER
// The code within this block will execute only on .NET 9 or higher
#endif

#if ANDROID
// The code within this block will execute only on the Android OS
#endif

#if DEBUG
// The code within this block will execute only in Debug mode
#endif

C# – Ignored Directives have a similar syntax but are ignored by the compiler because they are for tooling.

The real purpose of this feature is to execute a C# source file directly from the CLI. It doesn’t need a project file. Now, even the plain console app requires a project file, despite the much-simplified top-level statements feature.

Categories
.NET .NET 8 .NET 9 .NET Conf .NET MAUI Android Blazor C# Desktop Developer General Getting Started Hybrid iOS macOS Mobile Preview Tools Video Visual Studio VS Code Web What's New Windows Xamarin Xamarin.Forms

.NET MAUI – Enable Debugger-Detached XAML Live Preview in Visual Studio 2022

Not confined to .NET MAUI, the XAML Live Preview functions as an invaluable tool for inspecting the UI and its associated properties in XAML apps overall.

However, it is imperative that the app be connected to the debugger, is it not? Yes, that is prior to the intro of the debugger-detached XAML Live Preview in VS2022, v17.13 Preview 1.0.

Yesterday, during the .NET MAUI session at .NET Conf 2024 (YouTube clip linked), David and Rachel provided an insightful overview of its functionality.

To know about this virtual event, consult this .NET Conf 2024 article and this detailed article outlining the comprehensive features of .NET MAUI 9.

Categories
.NET .NET 9 .NET MAUI Android Blazor C# Desktop Developer F# General Getting Started Hybrid iOS macOS Mobile Visual Studio VS Code Web What's New Windows Xamarin Xamarin.Forms

What’s New in .NET MAUI 9: A Comprehensive Overview

.NET 9, the next major version of .NET following the annual release cadence, will be a Short-Term Support (STS) release, which will be supported for 18 months from release.

This release is packed with a broad set of features. The primary highlight is the support for Native AOT across app models.

In this article, we’ll explore the high-level features of .NET MAUI 9.