.NET Community Toolkit 8.4 Brings Partial Properties Support, New MVVM Toolkit Analyzers

Elliot Kim

Elliot Kim

December 13, 2024 · 3 min read
.NET Community Toolkit 8.4 Brings Partial Properties Support, New MVVM Toolkit Analyzers

Microsoft has announced the release of .NET Community Toolkit 8.4, a significant update that brings partial properties support to MVVM Toolkit source generators and introduces new MVVM Toolkit diagnostic analyzers. The update, unveiled on December 12, is now available for developers to leverage in their projects.

The .NET Community Toolkit 8.4 takes advantage of new C# language features in the .NET 9 SDK, enabling partial properties support in MVVM Toolkit source generators. This means that developers can now define observable properties using partial properties and semi-auto properties, making property declaration more integrated with the C# language. This change eliminates the need for the MVVM Toolkit to create a new property and infer its characteristics based on the annotated field.

In addition to partial properties support, the .NET Community Toolkit 8.4 introduces 16 new diagnostics to the set of analyzers in the MVVM Toolkit. These analyzers provide both general code analysis for MVVM scenarios and CsWinRT trim/AOT code analysis for UWP and WinUI 3. This enhancement will help developers identify and fix issues more efficiently, leading to improved code quality and reliability.

The update also includes several other changes and improvements. For instance, the MVVM Toolkit now includes MSBuild logic for friendly error messages when using an incorrect version of the Windows SDK package, providing suggestions on how to fix the issue and which version to use. Custom diagnostic suppressions now work correctly when using custom attribute targets on [ObservableProperty] fields. Furthermore, more WinRT analyzers have been added for class-level attributes, and NuGet packages can be updated to the latest stable version.

The .NET Community Toolkit is a collection of helpers and APIs that work for .NET developers, agnostic of any specific UI platform. This release follows the August release of .NET Community Toolkit 8.3, which brought support for .NET 8 and NativeAOT. The continuous updates to the .NET Community Toolkit demonstrate Microsoft's commitment to providing developers with the tools and features they need to build high-quality applications efficiently.

The source code for the .NET Community Toolkit can be found on GitHub, allowing developers to explore and contribute to the project. With the .NET Community Toolkit 8.4, Microsoft has taken another significant step towards enhancing the development experience for .NET developers, and it will be interesting to see how the community responds to these new features and improvements.

Similiar Posts

Copyright © 2024 Starfolk. All rights reserved.