[Arm64VS] Can't build C# WinUI project on Arm64 VS - Cannot resolve 'GenXbf.dll'
Describe the bug
The WinAppSdk contains the Arm64 version of GenXbf (tools\arm64\GenXbf.dll), but the targets need to be updated to use it when running on Arm64 OS. The equivalent change in other targets files use this in the condition to check for the Arn64 OS scenario:
'$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture)' == 'arm64'
Steps to reproduce the bug
- Install Arm64 VS on Arm64 OS
- Open a C# WinUI project (Target shouldn't matter, I hit this on 1.0.3 and 1.1.0-preview3)
- Build
Result: Build error
Cannot resolve 'GenXbf.dll' under path 'D:\Users\lukewest.nuget\packages\microsoft.windowsappsdk\1.0.3\buildTransitive..\tools\net472..\x64\genxbf.dll'.”
Expected behavior
Build uses the Arm64 version of GenXbf.dll and succeeds
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.1 Preview 3: 1.1.0-preview3
Windows app type
- [X] UWP
- [ ] Win32
Device form factor
Desktop
Windows version
Windows 11 (21H2): Build 22000
Additional context
No response
cc @evelynwu-msft
Tracked internally by https://task.ms/39763998
FYI Workaround: There is an ARM64 version of genxbf.dll in \tools\arm64\ of the package and if I take that and copy it into the x64 folder, the build does work. Looks like it is mostly an issue of not loading the correct DLL in the xaml compiler.
The issue nentioned by @dotMorten is tracked internally here: https://microsoft.visualstudio.com/OS/_workitems/edit/40425553
@dotMorten I'm glad you threw up this issue. I had already worked around it and then ran into it again (forgetting that I worked around it in a previous version) and was about to file it.
Should be fixed in 1.1.4 according to release notes
Yep, confirming, this was fixed in Microsoft.WindowsAppSDK v1.1.4:
Handy links:
I'm still seeing this in 1.1.4 with VS17.4.0preview1 on ARM64:

FYI @evelynwu-msft
@dotMorten If you're still getting this failure, please try a couple things:
- Update the project's Microsoft.Windows.SDK.BuildTools package reference to the latest (non-preview) version, 10.0.22621.1
- Update VS to 17.4 Preview 2 (should be released within the next couple of days)
If neither of those help, can you tell us if you hit this error on normal builds or does it only happen during packaging? And if it's just during packaging, please tell us if you're using the "Enable automatic updates" feature.
@MSLukeWest I just set up a CI job on an ARM64 machine, and moving the referenced package to 1.1.4 did actually resolve it there. I'll go back and look at why it wasn't working for me on another ARM64 PC. Probably safe to close this for now until I find more.