I've always had success building this project of mine that is based on MAUI, however today it started failing with this error when trying to compile it in Visual Studio for Windows:
Error WMC0621 Cannot resolve 'GenXbf.dll' under path 'C:\Users\knocte\Documents\Code\RIM\packages\microsoft.windowsappsdk\1.2.221209.1\buildTransitive..\tools\net472..\x64\genxbf.dll'. Please ensure that the Nuget was properly restored and that the path is available on disk. Frontend C:\Users\knocte\Documents\Code\RIM\packages\microsoft.windowsappsdk\1.2.221209.1\tools\x64\genxbf.dll 1
My project file has this fragment which seems very related to this:
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041</TargetFrameworks>
...
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<!-- Required? - WinUI does not yet have buildTransitive for everything -->
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.5.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221209.1" />
</ItemGroup>
This bug seems like a regression of this github issue.
As it is mentioned there that upgrading should do the trick (although they bring up version numbers that are older than what I had), then I changed my .csproj this way:
And it surprisingly did the trick.
BTW the beginning of the .csproj file had this: