-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Open
Copy link
Labels
analyzer 👓A new analyzer being implemented or updatedA new analyzer being implemented or updatedbug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviormvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkit
Description
Describe the bug
I have installed the new released .NET 10 SDK and created a new .NET 10 project.
After installing the CommunityToolkit.Mvvm v8.4.0 NuGet package, the project fails to build using the default project settings.
The compilation errors observed are:
MVVMTK0041 (Error related to the MVVM Toolkit Source Generator)
CS9248 and/or CS8050 (C# language version compatibility errors, suggesting a new C# feature is being used without adequate language support configured).
Workaround / Required Fix:
To resolve these errors and successfully compile the project with CommunityToolkit.Mvvm v8.4.0, I am required to explicitly set the LangVersion property to preview in the project file.
code:
Net10MvvmLib.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<!--<LangVersion>preview</LangVersion>-->
<LangVersion>14.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
</ItemGroup>
</Project>Person.cs
using CommunityToolkit.Mvvm.ComponentModel;
namespace Net10MvvmLib;
internal partial class Person : ObservableObject
{
[ObservableProperty]
public partial string Name { get; set; } = "John";
}
Regression
No response
Steps to reproduce
env:
Win 10.0.19044
dotnet SDK 10.0.100
visual studio 18.0.0
Expected behavior
Work properly.
Screenshots
No response
IDE and version
Other
IDE version
vs 2026 community
Nuget packages
- CommunityToolkit.Common
- CommunityToolkit.Diagnostics
- CommunityToolkit.HighPerformance
- CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.4.0
Additional context
No response
Help us help you
No, just wanted to report this
Odaronil, snechaev, DrPepperBianco, binarycow, MrJul and 1 moreali50m and MichaelShapiro
Metadata
Metadata
Assignees
Labels
analyzer 👓A new analyzer being implemented or updatedA new analyzer being implemented or updatedbug 🐛An unexpected issue that highlights incorrect behaviorAn unexpected issue that highlights incorrect behaviormvvm-toolkit 🧰Issues/PRs for the MVVM ToolkitIssues/PRs for the MVVM Toolkit