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 10 .NET 9 .NET MAUI Android Blazor C# Desktop Developer General Getting Started Hybrid iOS macOS Mobile Preview Templates Visual Studio VS Code Web What's New Windows Xamarin Xamarin.Forms

.NET MAUI 10 Preview: What’s New and How to Get Started

Last month, the first public preview of .NET 10, an LTS version, was released.

A detailed blog post describing the release overview is here.

Update: .NET 10 Preview 2 is now available and is detailed here. Comes with a lot of exciting new features. Try now.

Like .NET 9, details of preview releases for .NET 10 will also be published in the GitHub discussion, and Preview 1 is here.

And what’s changed in this .NET MAUI 10 Preview 1 is here. Have a look at the tentatively planned features on .NET 10 here and Roadmap here.

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

.NET MAUI 9: Introducing the HybridWebView Project Template

HybridWebView is one of the two prominent enhancements in .NET MAUI 9, the recently released major version of the cross-platform App UI framework.

An article that comprehensively outlines the significant features of this version has already been published and is accessible here.

Consult this article titled Exploring .NET MAUI 9 – HybridWebView to delve into the details of this new control.

Nonetheless, the components that constitute the HybridWebView project must be assembled manually, as there is no inherent template available akin to that of Blazor Hybrid. So, it is appropriate to include one in the .NET MAUI All-in-One Templates pack. As the name suggests, has a slew of features under the hood to work with .NET MAUI, consult the articles linked here to know more about them.

Glad to introduce a new project template using HybridWebView in the templates pack v6.1. This article will describe how to install and utilize this new project template.

Categories
.NET .NET 8 .NET 9 .NET MAUI Android Blazor C# Code Desktop Developer General Getting Started Hybrid iOS macOS Made Easy MVVM NuGet Preview Toolkit Visual Studio VS Code What's New Windows Xamarin Xamarin.Forms

MVVM Toolkit v8.4: Custom Access Modifiers for Partial Properties – How To

This article is part of the MVVM – Made Easy series, with a focus on the initial preview release of v8.4 of the CommunityToolkit.Mvvm (aka Microsoft MVVM Toolkit) NuGet package, which includes support for Partial Properties.

Update as of Dec 2024: The v8.4 stable release is now available. For further details, please refer to this blog post.

Here are the links to other articles in this series.

Support for Partial Properties is one of most sought after features in the MVVM toolkit as it allows to define custom access modifier for property accessors and makes code more readable. The need for an analyzer to track the usage of a field instead of a (generated) property is no longer necessary.

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

Getting Started with Syncfusion’s .NET MAUI Toolkit

Yesterday, Syncfusion, a prominent vendor of software components, announced its dedication to contributing to .NET MAUI and the release of the initial set of free and open-source controls for .NET MAUI, which is now available as a NuGet package titled Syncfusion.Maui.Toolkit.

Microsoft has gladly welcomed Syncfusion’s open-source contributions, a gesture seen as a positive step for .NET MAUI confirming the ongoing commitment to the cross-platform framework.

Syncfusion is utilizing its proficiency in developing software components to collaborate with Microsoft, with the objective of significantly enhancing .NET MAUI. Their team is already making a noteworthy impact.

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 9 .NET MAUI Android Blazor C# Desktop Embedding Events General Hybrid iOS macOS Mobile Standup Video Visual Studio VS Code Web What's New Windows WinUI 3 Xamarin Xamarin.Forms

Explore the .NET MAUI 9 Release Enhancements in September Community Standup

This September, the .NET MAUI monthly community standup discusses the.NET MAUI 9 release enhancements. The HybridWebView and amazing TitleBar for Windows are just the tip of the iceberg.

Remember to join live on Thu, Sep 5 at 17:30 UTCClick the link to access the timing in your local or preferred time zone. Note, that it’s half an hour behind the usual schedule.

Update: The community links for this month’s standup are here.

Happy coding. Stay connected as we continue to learn and share the experiences from this exciting journey of being a .NET developer.

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

SLNX – XML-based Visual Studio Solution Files – No more cryptic GUIDs – How to Manage from CLI

Comprehending the intricacies of a system often requires more than just deciphering the code itself. It also involves understanding the web of dependencies that are inextricably linked to it.

This includes navigating through solution files, project files, package references, static asset management, build configuration, and other related components.

With .NET going cross-platform, SDK-style projects have been introduced. The project files have been significantly simplified. They are now more comprehensible. Due to their XML-based nature, they can be easily modified using a basic text editor.

Nonetheless, the restructuring of the Visual Studio solution file is long overdue due to its intricate layout and obscure GUIDs.

Categories
.NET .NET 8 .NET 9 .NET MAUI Android Automation Blazor C# Desktop Developer DevOps Extensions General Getting Started Hybrid iOS Mobile NuGet Templates Visual Studio VS Code Web What's New Windows Xamarin Xamarin.Forms

.NET MAUI All-in-One Templates Pack v5.6: NuGet CPM and Nightly Builds Support

Firstly, .NET MAUI 9 Preview 5 has just been released. The changelog can be found here. Notably, a new Blazor Hybrid Web template has been introduced in this version.

In short, this new template abstracts the Razor components into a distinct Razor Class Library (RCL). Furthermore, it provides the ability to create Blazor Web projects within the same solution and refers to the shared RCL.

The concept of abstracting the Razor components is already facilitated by the Hybrid project templates within the All-in-One template pack.

dotnet new mauiapp -o MyApp -dp Hybrid -rcl

Will review the modifications and cover them in a distinct article.

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

Join Live: .NET MAUI Community Standup

The topic for this June month’s .NET MAUI community standup is VS Code Updates.

Of late, VS Code has incorporated many new features, such as XAML IntelliSense and Hot Reload, as the end of support for VS for Mac is quickly approaching (Aug 31, 2024).

Update: The community links for this month’s standup are here.

Refer to this article to start Using VS Code for .NET MAUI development.

David highlighted using MAUI Nightly Builds in the standup. Projects in the All-in-One templates pack already support utilizing the Nightly builds from version 4.6 onwards. However, setting up the package source from the CI feed involves a few manual steps as detailed in the earlier article.

But, automation is the need of the hour. The upcoming release of templates pack v5.6, scheduled for this week, will streamline the process by eliminating manual steps, ensuring seamless functionality when selecting the Nightly builds option upon project creation. Cool 😊.

Update: v5.6 has just been released. Consult this article for further details.

Remember to join live on Thu, Jun 6 at 17:00 UTCClick the link to access the timing in your local/preferred time zone. Note, it’s back at the same time.

Happy coding. Stay connected as we continue to learn and share the experiences from this exciting journey of being a .NET developer.