The .NET Community Toolkit has officially released version 8.4, introducing significant updates and improvements. The latest release includes support for partial properties in the MVVM Toolkit generators, new diagnostic analyzers, bug fixes, and other enhancements to facilitate development workflows.
One of the key highlights is the introduction of partial properties for the MVVM Toolkit, enabled by new C# language features available in the .NET 9 SDK. As stated, this enhancement integrates property declarations more closely with the C# language, improving support for modifiers such as new, sealed, override, and required. Developers can now apply custom attributes and accessibility modifiers to properties, fields, or accessors.
Partial properties also enhance nullability annotations and provide compatibility with Native AOT in UWP and WinUI 3 applications. Additionally, as reported, an upcoming Visual Studio update will simplify navigation between partial property declarations and their implementations.
Furthermore, a new code fixer in Visual Studio further supports the transition to partial properties, enabling developers to migrate existing [ObservableProperty] fields with, as stated “a single click”. This migration is recommended for projects using CsWinRT to benefit from improved performance and enhanced language support.
(Code fixer in Visual Studio, Source: Microsoft DevBlog)
The release also brings an expanded set of diagnostic analyzers for the MVVM Toolkit. These analyzers address common coding issues, such as unsupported types or incorrect declarations, and improve code quality for MVVM scenarios. Specific analyzers introduced in version 8.4 include checks for language version compatibility, AOT compatibility for WinRT scenarios, and proper usage of [ObservableProperty] and [RelayCommand].
With a note, developers are advised to set <LangVersion>preview</LangVersion> in their project files to enable partial properties and ensure compatibility with the new features.
Several additional improvements have been made in this release. These include validation of the Windows SDK version through MSBuild logic, support for forwarding attributes to property accessors, and refined diagnostic suppressions for custom attribute targets.
Additionally, debugging has been simplified with embedded .pdb files for all source generators and analyzers, and performance improvements have been implemented for several toolkit components.
Other notable updates include a new AsStream() extension for ReadOnlySequence<byte>, enabling developers to create readonly, seekable streams more efficiently. The IndexOf<T> extension now uses ref readonly, emphasizing its intended usage.
The .NET Community Toolkit team encourages developers to explore the new features and share feedback to help refine future updates. For a complete overview and guidance, the toolkit’s official release notes provide detailed documentation.