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 Events General Hybrid iOS macOS Mobile Visual Studio VS Code Web Windows Xamarin Xamarin.Forms

Join .NET Conf 2024 Online: Explore .NET 9 Features

November is set to be an exceptionally significant month for .NET developers globally, as a new version of .NET will be officially released during its annual event, .NET Conf. Similar to previous years, this year’s event will also be conducted virtually, allowing participation online. The highly anticipated .NET 9 is scheduled for release during this conference, which will take place over three days from Tue, Nov 12, 2024, to Thu, Nov 14, 2024. Please mark your calendars accordingly.

.NET Conf 2024 - Annual Virtual Developer Event - Release of .NET 9
.NET Conf 2024 – Annual Virtual Developer Event – Release of .NET 9

Quite like .NET 7, .NET 9 is also a short-term support (STS) release, which will be supported for 18 months till mid-May 2026. Even-numbered releases are LTS whereas odd-numbered are STS. More details on the release lifecycle are here. The support for .NET 6 (the previous LTS release) ends (more details here), with .NET 7 already out of support, and .NET 8, the current LTS release, has another 2 years of support till early Nov 2026.

.NET Release Schedule
.NET Release Schedule

Due to the underlying external dependencies, the support policy of .NET MAUI differs significantly from .NET, each major release will be supported only for 18 months. So, if you’re using .NET MAUI 8, support will cease by mid-May 2025 (in another 6 months). Hence, it’s necessary to plan for your app migration to .NET MAUI 9. An article has already been published detailing the comprehensive features of .NET MAUI 9.

Categories
.NET .NET 8 .NET 9 .NET MAUI Blazor C# Code Desktop Developer General Hybrid Mobile MVVM NuGet Quick Fix Windows Windows 10 Windows 11 WinUI 3 Xamarin Xamarin.Forms

CommunityToolkit.Mvvm: Resolving Windows 10 MVVM Project Build Issues

Undoubtedly, CommunityToolkit.Mvvm, aka Microsoft MVVM Toolkit, has recently become one of the most popular NuGet packages among MVVM developers.

It effectively abstracts away the boilerplate code, enabling developers to concentrate exclusively on the task.

However, after the release of package version 8.3 and later, while building the project referencing this Toolkit has encountered failures, accompanied by perplexing error messages like System.TypeInitializationException or Found conflicts between different versions of 'WinRT.Runtime' that could not be resolved. when targeting the Windows 10 platform.

Categories
.NET .NET MAUI Android Blazor C# Desktop Developer Events General Hybrid iOS Learn macOS Mobile MSBuild Web Windows Xamarin Xamarin.Forms

Microsoft Build 2024: AI-Focused Sessions and .NET Highlights

It’s the month of May, so it’s time for Microsoft Build, its annual developer conference, where it’ll showcase the innovative features to the community.

It’s the age of AI, which is disrupting the status quo. So most of the sessions are scheduled along that line as expected.

For .NET MAUI, Blazor, and C#, these are the highly recommended sessions to watch.

Categories
.NET .NET 8 .NET 9 .NET MAUI Blazor Desktop Developer Extensions General Getting Started Hybrid NuGet Templates Visual Studio VS Code Web What's New Windows Xamarin

.NET Blazor Hybrid – Windows Desktop Templates

Windows Forms and WPF are proven solid frameworks for creating high-performance Windows desktop client applications.

Blazor, a framework for full-stack web development with C# and Razor.

When these two technologies come together, then it’s certainly a delight for the .NET developers as it paves the way to leverage the skills they’re already familiar with and an option to modernize the existing applications.

Categories
.NET .NET 8 .NET MAUI Blazor Code Desktop Developer Hybrid Windows WinUI 3 Xamarin

.NET MAUI – Blazor Hybrid – WinUI 3

.NET MAUI and Blazor – Best of both modern technologies for Mobile, Desktop, and Web solutions from a single codebase.

But app development is of two categories: Existing ones and Greenfield development. New features can be part of the latter quite easily as they’re done from scratch but definitely not that easy on the former as existing investments need to be protected. Changes can be quite expensive as they need to be thoroughly validated before rolling out to production use.

Categories
.NET MAUI Blazor Code Deep Dive Desktop Developer Hybrid Mobile Web Xamarin

Blazor – All along the way – Hybrid Apps

This is the fourth article in the .NET MAUI – Blazor series and have provided links for the other 3 articles previously published.

This article primarily focuses on the Blazor Hybrid scenarios.

The reason is the potential of Blazor, the modern web UI stack based on Razor SDK and allows to work with C# language constructs which can be used across multiple frameworks with the introduction of BlazorWebView, now officially supported on .NET MAUI, classic Windows desktop application frameworks such as Windows Forms (WinForms) and WPF.