Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObservableProperty seems to break JSON Deserialization when used with JsonSerializerContext #893

Closed
1 of 4 tasks
karmeye opened this issue Jun 26, 2024 · 19 comments
Closed
1 of 4 tasks
Labels
analyzer 👓 A new analyzer being implemented or updated by design Some behavior that is intended and not an issue mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit

Comments

@karmeye
Copy link

karmeye commented Jun 26, 2024

Describe the bug

Using this, the property is not populated with the json value.

[ObservableProperty]
[property: JsonPropertyName("from_uuid")]
[property: JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
private string? fromUuid;

However, if I write it manually it works.

[JsonPropertyName("from_uuid")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? FromUuid
{
    get => fromUuid;
    set
    {
        if (!EqualityComparer<string?>.Default.Equals(fromUuid, value))
        {
            fromUuid = value;
            OnPropertyChanged(nameof(FromUuid));
        }
    }
}
private string? fromUuid;

Regression

No response

Steps to reproduce

See description above. Use source-generation based serialization rather than reflection.

Expected behavior

I would expect it to deserialize. Not sure if it's Mvvm issue or System.Text.Json. But reported it here.

Screenshots

No response

IDE and version

VS 2022

IDE version

No response

Nuget packages

  • CommunityToolkit.Common
  • CommunityToolkit.Diagnostics
  • CommunityToolkit.HighPerformance
  • CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.2.2

Additional context

Probably serialization also doesn't work.

Help us help you

No, just wanted to report this

@karmeye karmeye added the bug 🐛 An unexpected issue that highlights incorrect behavior label Jun 26, 2024
@karmeye karmeye changed the title Seems to break JSON Deserialization when used with JsonSerializationContext Seems to break JSON Deserialization when used with JsonSerializerContext Jun 26, 2024
@karmeye karmeye changed the title Seems to break JSON Deserialization when used with JsonSerializerContext ObservableProperty seems to break JSON Deserialization when used with JsonSerializerContext Jun 26, 2024
@puli1027
Copy link

I also encountered this problem

@stephenquan
Copy link

I also encountered this issue with the following sample class:

public partial class Person : ObservableObject
{
    [ObservableProperty]
    [property: JsonPropertyName("f")]
    [NotifyPropertyChangedFor(nameof(FullName))]
    string firstName = string.Empty;

    [ObservableProperty]
    [property: JsonPropertyName("n")]
    [NotifyPropertyChangedFor(nameof(FullName))]
    string lastName = string.Empty;

    public string FullName => $"{FirstName} {LastName}";
}

With the application encountering an exception on startup. This appears to be a regression in CommunityToolkit.Mvvm 8.3.0 whereas it is working in 8.2.2.

I created a standalone repo https://github.com/stephenquan/Maui.Mvvm.Json.Test that demonstrates this.

@Sergio0694
Copy link
Member

@stephenquan are you able to provide a minimal repro, possibly like a unit test or some self-contained code snippet that replicates the issue? Are you seeing differences in the generated code between 8.2.2 and 8.3.0 in your case? Thank you!

@stephenquan
Copy link

stephenquan commented Aug 28, 2024

@Sergio0694 see my comment where I provided a github repo that is a minimal repro. I checked in the 8.2.2 generated file for Person.cs https://github.com/stephenquan/Maui.Mvvm.Json.Test/blob/main/GeneratedFiles/Maui.Mvvm.Json.Test.Person.g.cs.txt and the 8.3.0 generated file is in the mvvm-8.3.0 branch https://github.com/stephenquan/Maui.Mvvm.Json.Test/blob/mvvm-8.3.0/GeneratedFiles/Maui.Mvvm.Json.Test.Person.g.cs.txt

You can see the changes between 8.2.2 to 8.3.0 included the GeneratedFiles thru this commit reference: stephenquan/Maui.Mvvm.Json.Test@a8f06ce

@Sergio0694
Copy link
Member

Yeah I saw that, that's why I asked for a minimal repro, as in, a self-contained snippet. If you actually meant that that is a minimal repro, as in, removing MAUI doesn't reproduce the issue anymore, then I suspect this might be unrelated from the MVVM Toolkit itself. I don't even have the MAUI workload installed, that's also why I'm asking for a standalone minimal repro 🙂

@Sergio0694
Copy link
Member

The generated code is identical (except for INotifyPropertyChanging events, I assume you disabled that?) 🤔

@stephenquan
Copy link

I don't know why the changing events look different. It definitely wasn't intentional.

@stephenquan
Copy link

stephenquan commented Aug 28, 2024

The exceptions in my app are .NET MAUI errors. Below is the exception/stacktrace when the app is in it's startup sequence. I will try creating another app, say, a console app.

at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
at Microsoft.Maui.Controls.ShellContent.<>c__DisplayClass19_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0()
at Microsoft.Maui.Controls.ElementTemplate.CreateContent()
at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent(DataTemplate self, Object item, BindableObject container)
at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent()
at Microsoft.Maui.Controls.Handlers.ShellContentHandler.CreatePlatformElement()
at Microsoft.Maui.Handlers.ElementHandler2.OnCreatePlatformElement() at Microsoft.Maui.Handlers.ElementHandler.CreatePlatformElement() at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context) at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context) at Microsoft.Maui.Controls.Handlers.ShellSectionHandler.SyncNavigationStack(Boolean animated, NavigationRequestedEventArgs e) at Microsoft.Maui.Controls.Handlers.ShellSectionHandler.MapCurrentItem(ShellSectionHandler handler, ShellSection item) at Microsoft.Maui.PropertyMapper2.<>c__DisplayClass5_0.b__0(IElementHandler h, IElement v)
at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Handlers.ShellSectionHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
at Microsoft.Maui.Controls.Handlers.ShellItemHandler.UpdateCurrentItem()
at Microsoft.Maui.Controls.Handlers.ShellItemHandler.MapCurrentItem(ShellItemHandler handler, ShellItem item)
at Microsoft.Maui.PropertyMapper2.<>c__DisplayClass5_0.<Add>b__0(IElementHandler h, IElement v) at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView) at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView) at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) at Microsoft.Maui.Controls.Handlers.ShellItemHandler.SetVirtualView(IElement view) at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context) at Microsoft.Maui.Controls.Platform.ShellView.CreateShellItemView() at Microsoft.Maui.Controls.Platform.ShellView.SwitchShellItem(ShellItem newItem, Boolean animate) at Microsoft.Maui.Controls.Handlers.ShellHandler.MapCurrentItem(ShellHandler handler, Shell view) at Microsoft.Maui.PropertyMapper2.<>c__DisplayClass5_0.b__0(IElementHandler h, IElement v)
at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Handlers.ViewHandler2.SetVirtualView(IView view) at Microsoft.Maui.Controls.Handlers.ShellHandler.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ViewHandler2.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
at Microsoft.Maui.Handlers.WindowHandler.MapContent(IWindowHandler handler, IWindow window)
at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0.b__0(IElementHandler h, IElement v)
at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Platform.ElementExtensions.SetHandler(IWinRTObject nativeElement, IElement element, IMauiContext context)
at Microsoft.Maui.Platform.ElementExtensions.SetWindowHandler(Window platformWindow, IWindow window, IMauiContext context)
at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(Application platformApplication, IApplication application, OpenWindowRequest args)
at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(Application platformApplication, IApplication application, LaunchActivatedEventArgs args)
at Microsoft.Maui.MauiWinUIApplication.OnLaunched(LaunchActivatedEventArgs args)
at Microsoft.UI.Xaml.Application.Microsoft.UI.Xaml.IApplicationOverrides.OnLaunched(LaunchActivatedEventArgs args)
at ABI.Microsoft.UI.Xaml.IApplicationOverrides.Do_Abi_OnLaunched_0(IntPtr thisPtr, IntPtr args)

@Sergio0694
Copy link
Member

"I don't know why the changing events look different. It definitely wasn't intentional."

Oh I see, that's due to #722. By the way, in 8.3.0, you use:

<PropertyGroup>
  <MvvmToolkitEnableINotifyPropertyChangingSupport>false</MvvmToolkitEnableINotifyPropertyChangingSupport>
</PropertyGroup>

If you want to disable support for INotifyPropertyChanging entirely, if you don't need it.

@stephenquan
Copy link

stephenquan commented Aug 28, 2024

@Sergio0694 I tried the Person class in a straight console top-level application and it works with CommunityToolkit.Maui 8.3.0 with no issue. Would you like me to split my issue into a new one that is "MAUI + CommunityToolkit.Mvvm 8.3.0 + Json" ? Also, because it's MAUI, I'm unsure if my issue belongs in this repo anymore or over in https://github.com/dotnet/maui ?

using CommunityToolkit.Mvvm.ComponentModel;
using System.Text.Json.Serialization;
using System.Text.Json;
string json = @"{""f"":""John"",""n"":""Doe""}";
var person = JsonSerializer.Deserialize<Person>(json);
Console.WriteLine(person.FullName); // Output: John Doe
public partial class Person : ObservableObject
{
    [ObservableProperty]
    [property: JsonPropertyName("f")]
    [NotifyPropertyChangedFor(nameof(FullName))]
    string firstName = string.Empty;
    [ObservableProperty]
    [property: JsonPropertyName("n")]
    [NotifyPropertyChangedFor(nameof(FullName))]
    string lastName = string.Empty;
    public string FullName => $"{FirstName} {LastName}";
}

@Sergio0694
Copy link
Member

@stephenquan could you try #923 (comment) in your MAUI app with 8.3.0 and see if that fixes the crash? I wonder if it's the same issue.

@stephenquan
Copy link

Hi @Sergio0694, thanks for the suggestion, so, I tried adding a WindowsSdkPackageVersion to match the TargetFrameworks .NET MAUI sets, and this is what it looks like:

<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<WindowsSdkPackageVersion Condition="$([MSBuild]::IsOSPlatform('windows'))">10.0.19041.0</WindowsSdkPackageVersion>

But it resulted in the following error:

1>F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test.csproj : error NU1102: Unable to find package Microsoft.Windows.SDK.NET.Ref with version (= 10.0.19041)
1>F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test.csproj : error NU1102: - Found 263 version(s) in NuGet [ Nearest version: 10.0.19041.1-preview ]

So I bumped the WindowsSdkPackageVersion up

<WindowsSdkPackageVersion Condition="$([MSBuild]::IsOSPlatform('windows'))">10.0.19041.1-preview</WindowsSdkPackageVersion>

But this generates a new issue:

1>C:\Program Files\dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Windows.targets(55,5): error NETSDK1148: A referenced assembly was compiled using a newer version of Microsoft.Windows.SDK.NET.dll. Please update to a newer .NET SDK in order to reference this assembly.

Incidentally, I decided to target my .NET MAUI project for Android, and, surprisingly, the application was built and ran with no issue! So the problem seems to be windows only.

@stephenquan
Copy link

Also, I note that when my project restore it produces a lot of warnings (note this is before trying your workaround):

Rebuild started at 2:22 PM...
1>------ Rebuild All started: Project: Maui.Mvvm.Json.Test, Configuration: Debug Any CPU ------
Restored F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test.csproj (in 3 sec).
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Found conflicts between different versions of "WinRT.Runtime" that could not be resolved.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: There was a conflict between "WinRT.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" and "WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: "WinRT.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" was chosen because it was primary and "WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" was not.
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: References which depend on "WinRT.Runtime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" [F:.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.31\lib\net6.0\WinRT.Runtime.dll].
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.31\lib\net6.0\WinRT.Runtime.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.31\lib\net6.0\WinRT.Runtime.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windows.sdk.net.ref\10.0.19041.31\lib/net6.0/WinRT.Runtime.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: References which depend on or have been unified to "WinRT.Runtime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=99ea127f02d97709" [].
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\communitytoolkit.mvvm\8.3.0\lib\net8.0-windows10.0.17763\CommunityToolkit.Mvvm.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\communitytoolkit.mvvm\8.3.0\lib\net8.0-windows10.0.17763\CommunityToolkit.Mvvm.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\communitytoolkit.mvvm\8.3.0\lib\net8.0-windows10.0.17763\CommunityToolkit.Mvvm.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.graphics.win2d\1.2.0\lib\net6.0-windows10.0.19041.0\Microsoft.Graphics.Canvas.Interop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.graphics.win2d\1.2.0\lib\net6.0-windows10.0.19041.0\Microsoft.Graphics.Canvas.Interop.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.graphics.win2d\1.2.0\lib\net6.0-windows10.0.19041.0\Microsoft.Graphics.Canvas.Interop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.InteractiveExperiences.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.InteractiveExperiences.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.InteractiveExperiences.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.graphics.win2d\1.2.0\lib\net6.0-windows10.0.19041.0\Microsoft.Graphics.Canvas.Interop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.graphics.win2d\1.2.0\lib\net6.0-windows10.0.19041.0\Microsoft.Graphics.Canvas.Interop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppLifecycle.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppLifecycle.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppLifecycle.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.AppNotifications.Builder.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.Resources.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.Resources.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.Resources.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.graphics.win2d\1.2.0\lib\net6.0-windows10.0.19041.0\Microsoft.Graphics.Canvas.Interop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.compatibility\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Compatibility.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.controls.xaml\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Controls.Xaml.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.core\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.essentials\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Essentials.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.maui.graphics.win2d.winui.desktop\8.0.80\lib\net8.0-windows10.0.19041\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Management.Deployment.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.PushNotifications.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.PushNotifications.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.PushNotifications.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Security.AccessControl.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Security.AccessControl.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Security.AccessControl.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Power.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Power.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Power.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.System.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Widgets.Projection.dll
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: Project file item includes which caused reference "F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Widgets.Projection.dll".
1>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(2401,5): warning MSB3277: F:.nuget\packages\microsoft.windowsappsdk\1.5.240627000\lib\net6.0-windows10.0.18362.0\Microsoft.Windows.Widgets.Projection.dll
1>Maui.Mvvm.Json.Test -> F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\bin\Debug\net8.0-maccatalyst\maccatalyst-x64\Maui.Mvvm.Json.Test.dll
1>Maui.Mvvm.Json.Test -> F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\bin\Debug\net8.0-ios\iossimulator-x64\Maui.Mvvm.Json.Test.dll
1>Done building project "Maui.Mvvm.Json.Test.csproj".
1>Maui.Mvvm.Json.Test -> F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\bin\Debug\net8.0-windows10.0.19041.0\win10-x64\Maui.Mvvm.Json.Test.dll
1>Maui.Mvvm.Json.Test -> F:\Maui\Maui.Mvvm.Json.Test\Maui.Mvvm.Json.Test\bin\Debug\net8.0-android\Maui.Mvvm.Json.Test.dll

@Sergio0694
Copy link
Member

<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<WindowsSdkPackageVersion Condition="$([MSBuild]::IsOSPlatform('windows'))">10.0.19041.0</WindowsSdkPackageVersion>

This is not correct and it's not what I suggested in the comment I linked at all. The package version must end with .41, ie:

<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<WindowsSdkPackageVersion Condition="$([MSBuild]::IsOSPlatform('windows'))">10.0.19041.41</WindowsSdkPackageVersion>

@Sergio0694
Copy link
Member

"the problem seems to be windows only."

Yes, again, like I said in the other issue, this is just an issue with the Windows SDK projections. Just try .41 in your project 🙂

@stephenquan
Copy link

Thanks @Sergio0694 , using a package version ending in .41 has resolved the issue for me. As far as I'm concerned, this problem is solved. I don't know if you need to wait for @karmeye to do the same to close this issue.

@RFBomb
Copy link

RFBomb commented Sep 12, 2024

I'd like to chime in that I'm encountering this as well, but I think the problem may be with the JSON generator, and not this generator.

Here is my class :

public partial class SlotGroup {

        [ObservableProperty][property: JsonPropertyName(nameof(Name))] protected string name;
        [ObservableProperty][property: JsonPropertyName(nameof(Description))] private string description;
        [ObservableProperty][property: JsonPropertyName(nameof(ChartTitle))] private string chartTitle;
        [ObservableProperty][property: JsonPropertyName(nameof(IsDarkMode))] private bool isDarkMode;
        [ObservableProperty][property: JsonPropertyName(nameof(ShowLegend))] private bool showLegend;

        [JsonPropertyName("slots")]
        public List<SlotGroupItem> Slots { get; init; }

        [JsonSerializable(typeof(SlotGroup))]
        [JsonSerializable(typeof(SlotGroup[]))]
        [JsonSourceGenerationOptions(IncludeFields = false, AllowTrailingCommas = true, WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata)]
        public partial class SerializerContext : JsonSerializerContext
        {
        }
}

Here is the generated code for one of the properties -- this looks fine to me:

/// <inheritdoc cref="name"/>
[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.Mvvm.SourceGenerators.ObservablePropertyGenerator", "8.2.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.Text.Json.Serialization.JsonPropertyNameAttribute("Name")]
public string Name
{
    get => name;
    set
    {
        if (!global::System.Collections.Generic.EqualityComparer<string>.Default.Equals(name, value))
        {
            OnNameChanging(value);
            OnNameChanging(default, value);
            OnPropertyChanging(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangingArgs.Name);
            name = value;
            OnNameChanged(value);
            OnNameChanged(default, value);
            OnPropertyChanged(global::CommunityToolkit.Mvvm.ComponentModel.__Internals.__KnownINotifyPropertyChangedArgs.Name);
        }
    }
}

And finally the snippet from the json source generator, which seems to me that it is blind to the attribute that is being applied to the generated property (the only property the json sees is the explicit one)

private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SlotGroupPropInit(global::System.Text.Json.JsonSerializerOptions options)
{
    var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];

    var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<global::System.Collections.Generic.List<global::WittmannUsa.OscilloscopeClient.Models.SlotGroupItem>>
    {
        IsProperty = true,
        IsPublic = true,
        IsVirtual = false,
        DeclaringType = typeof(global::WittmannUsa.OscilloscopeClient.Models.SlotGroup),
        Converter = null,
        Getter = static obj => ((global::WittmannUsa.OscilloscopeClient.Models.SlotGroup)obj).Slots,
        Setter = static (obj, value) => throw new global::System.InvalidOperationException("Setting init-only properties is not supported in source generation mode."),
        IgnoreCondition = null,
        HasJsonInclude = false,
        IsExtensionData = false,
        NumberHandling = null,
        PropertyName = "Slots",
        JsonPropertyName = "slots"
    };
    
    properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo<global::System.Collections.Generic.List<global::WittmannUsa.OscilloscopeClient.Models.SlotGroupItem>>(options, info0);

    return properties;
}

--- Workaround ---

Now, all this being said I did figure out a workaround. The SerializerContext is a public class contained within the parent that it will be serializing. ( so for me its SlotGroup.SerializerContext ), then you use the 'JsonInclude' on any private fields you need serialized. Since they are included via [JsonInclude], they you do not need to specify 'IncludeFields' in the context options.

Note that this workaround will not work if referencing another item with [ObservableProperty], as this serializer won't have permission to access those private fields. As such you may require some converters or referencing those other class's SerializerContexts setup in the same fashion.

[ObservableProperty][JsonInclude] private string name;
[ObservableProperty][JsonInclude] private string description;
[ObservableProperty][JsonInclude] private string chartTitle;
[ObservableProperty][JsonInclude] private bool isDarkMode;
[ObservableProperty][JsonInclude] private bool showLegend;

[JsonPropertyName("slots")]
public List<SlotGroupItem> Slots { get; init; }

[JsonSerializable(typeof(SlotGroup))]
[JsonSerializable(typeof(SlotGroup[]))]
[JsonSourceGenerationOptions(AllowTrailingCommas = true, WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata)]
public partial class SerializerContext : JsonSerializerContext
{
}

@karmeye
Copy link
Author

karmeye commented Nov 5, 2024

This is also the case when enabling the configuration source generator, e.g, binding a config section to a class that has [ObservableProperty] on a field: the property will not be generated.

So it's not just with System.Text.Json.

@Sergio0694
Copy link
Member

This is a known issue caused by the fact that source generators can't see each other's outputs.
It's fixed by #555, you'll need to switch to using partial properties here to enable this scenario 🙂

@Sergio0694 Sergio0694 added by design Some behavior that is intended and not an issue mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit analyzer 👓 A new analyzer being implemented or updated and removed bug 🐛 An unexpected issue that highlights incorrect behavior labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 👓 A new analyzer being implemented or updated by design Some behavior that is intended and not an issue mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit
Projects
None yet
Development

No branches or pull requests

5 participants