Skip to content

[inflight][Windows] Upgrade Microsoft.Graphics.Win2D from 1.2.0 to 1.3.2 to fix a build warning #28953

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

Open
wants to merge 6 commits into
base: inflight/current
Choose a base branch
from

Conversation

MartyIX
Copy link
Contributor

@MartyIX MartyIX commented Apr 12, 2025

This is #28885 targetting the inflight/current branch.

Description of Change

These warnings appear when one builds Essentials.DeviceTests.csproj (and other projects):

D:\a\1\s\.dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(43,3): warning MSB4011: "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.Build.Msix.props" cannot be imported again. It was already imported at "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.WinUI.props (22,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\a\1\s\src\Essentials\src\Essentials.csproj]
D:\a\1\s\.dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(43,3): warning MSB4011: "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.Build.Msix.props" cannot be imported again. It was already imported at "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.WinUI.props (22,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\a\1\s\src\Essentials\src\Essentials.csproj]
D:\a\1\s\.dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(43,3): warning MSB4011: "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.Build.Msix.props" cannot be imported again. It was already imported at "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.WinUI.props (22,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj]
D:\a\1\s\.dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(43,3): warning MSB4011: "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.Build.Msix.props" cannot be imported again. It was already imported at "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.WinUI.props (22,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj]
D:\a\1\s\.dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(43,3): warning MSB4011: "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.Build.Msix.props" cannot be imported again. It was already imported at "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.WinUI.props (22,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj]
D:\a\1\s\.dotnet\sdk\9.0.100\Microsoft.Common.CurrentVersion.targets(43,3): warning MSB4011: "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.Build.Msix.props" cannot be imported again. It was already imported at "C:\Users\VssAdministrator\.nuget\packages\microsoft.windowsappsdk\1.5.240227000\buildTransitive\Microsoft.WinUI.props (22,3)". This is most likely a build authoring error. This subsequent import will be ignored. [D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj]

(Full CI output)

Notice that the warnings mention WinAppSDK version 1.5 and not 1.6 that is used by MAUI right now.

It appears to be caused by using older version of Microsoft.Graphics.Win2D (i.e. 1.2.0 instead of the latest 1.3.2) -- see dependencies of 1.2.0. Version 1.3.2 requires WinAppSDK 1.6..

Changelog for the library is available here: https://github.com/microsoft/Win2D/blob/winappsdk/main/CHANGELOG.md.

@MartyIX MartyIX requested a review from a team as a code owner April 12, 2025 15:21
@MartyIX MartyIX requested review from jfversluis and tj-devel709 and removed request for a team April 12, 2025 15:21
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Apr 12, 2025
Copy link
Contributor

Hey there @@MartyIX! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MartyIX
Copy link
Contributor Author

MartyIX commented Apr 13, 2025

I can see

image

and those fails on CI.

However, these tests fail on my machine

image

but I cannot see the error message in the CI output.

Any tip how to resolve this would be welcome.

@MartyIX
Copy link
Contributor Author

MartyIX commented Apr 15, 2025

@Sergio0694 Would you know what to do with the CI error please:

C:\a_work_temp\test-dir\packages\microsoft.graphics.win2d\1.3.2\buildTransitive\net6.0-windows10.0.19041.0\Microsoft.Graphics.Win2D.targets(32,5): error WIN2D0001: 'Microsoft.Graphics.Canvas.dll' cannot be referenced correctly, because the project is being built as 'AnyCPU'. Please specify a specific platform (eg. 'x64'), publish with a RID (runtime identifier, eg. 'win-x64'), or set 'Win2DWarnNoPlatform' to suppress this error (note: you'll need to manually handle referencing the Win2D .dll in that case). [C:\a_work_temp\test-dir\PackCoreLibmaui321403934\PackCoreLibmaui321403934.csproj::TargetFramework=net9.0-windows10.0.19041.0]
PackCoreLibmaui321403934 -> C:\a_work_temp\test-dir\PackCoreLibmaui321403934\bin\Release\net9.0-ios\PackCoreLibmaui321403934.dll
PackCoreLibmaui321403934 -> C:\a_work_temp\test-dir\PackCoreLibmaui321403934\bin\Release\net9.0-windows10.0.19041.0\PackCoreLibmaui321403934.dll
PackCoreLibmaui321403934 -> C:\a_work_temp\test-dir\PackCoreLibmaui321403934\bin\Release\net9.0-maccatalyst\PackCoreLibmaui321403934.dll
PackCoreLibmaui321403934 -> C:\a_work_temp\test-dir\PackCoreLibmaui321403934\bin\Release\net9.0-tizen\PackCoreLibmaui321403934.dll
PackCoreLibmaui321403934 -> C:\a_work_temp\test-dir\PackCoreLibmaui321403934\bin\Release\net9.0-android\PackCoreLibmaui321403934.dll

@Sergio0694
Copy link

Mmh that warning should've been there before too, are you only getting it now? 🤔
The behavior is expected, Win2D isn't meant to be used in AnyCPU projects.
You can disable it by setting that property the error message mentions.

@MartyIX
Copy link
Contributor Author

MartyIX commented Apr 15, 2025

Mmh that warning should've been there before too, are you only getting it now? 🤔

Yes. It was not there before.

The behavior is expected, Win2D isn't meant to be used in AnyCPU projects.
You can disable it by setting that property the error message mentions.

To be honest, I'm not too sure where to put it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants