CommunityToolkit / dotnet

.NET Community Toolkit is a collection of helpers and APIs that work for all .NET developers and are agnostic of any specific UI platform. The toolkit is maintained and published by Microsoft, and part of the .NET Foundation.
https://docs.microsoft.com/dotnet/communitytoolkit/?WT.mc_id=dotnet-0000-bramin
Other
2.98k stars 293 forks source link

Mvvm 8.3.0: Wrong windows runtime? #928

Closed marco-skizza closed 3 weeks ago

marco-skizza commented 3 weeks ago

Describe the bug

Hi

When including...

<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.0" />

...in a sample .NET MAUI 8 project, when building for windows I get the following warnings:

warning MSB3277: Found conflicts between different versions of "WinRT.Runtime" that could not be resolved.
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".

It seems that this NuGet uses the windows runtime net8.0-windows10.0.17763.

Is this correct? Because .NET MAUI 8 projects use net8.0-windows10.0.19041.0:

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

But maybe there's even another reason for this build warnings. Besides, with version 8.2.2 of the NuGet everything was ok...

See also: https://github.com/CommunityToolkit/Maui/issues/2162

Regression

8.2.2

Steps to reproduce

1. Build the project from the repo for windows

Expected behavior

No build warnings.

Screenshots

No response

IDE and version

VS 2022

IDE version

17.11.2

Nuget packages

Nuget package version(s)

8.3.0

Additional context

No response

Help us help you

No, just wanted to report this

Sergio0694 commented 3 weeks ago

Duplicate of #923, the workaround is in https://github.com/CommunityToolkit/dotnet/issues/923#issuecomment-2314444048 🙂

The issue is you're using a .NET SDK that's not been updated yet with the new Windows SDK projections.

marco-skizza commented 3 weeks ago

Thanks! I think I'll wait then for the new SDK to come out... 😅

Balkoth commented 2 weeks ago

Duplicate of #923, the workaround is in #923 (comment) 🙂

The issue is you're using a .NET SDK that's not been updated yet with the new Windows SDK projections.

The issue is you are using something, that seems not to be available to the public. Why break this for all users of this library and not wait until the tools are finally around? Theres almost a year between 8.2.2 and 8.3.0 and you feel the need to release now?