microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

[Arm64VS] Can't build C# WinUI project on Arm64 VS - Cannot resolve 'GenXbf.dll'

Open MSLukeWest opened this issue 3 years ago • 5 comments

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

  1. Install Arm64 VS on Arm64 OS
  2. Open a C# WinUI project (Target shouldn't matter, I hit this on 1.0.3 and 1.1.0-preview3)
  3. 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

MSLukeWest avatar May 24 '22 18:05 MSLukeWest

cc @evelynwu-msft

asklar avatar May 26 '22 04:05 asklar

Tracked internally by https://task.ms/39763998

krschau avatar Jul 11 '22 18:07 krschau

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.

dotMorten avatar Jul 18 '22 19:07 dotMorten

The issue nentioned by @dotMorten is tracked internally here: https://microsoft.visualstudio.com/OS/_workitems/edit/40425553

MSLukeWest avatar Jul 18 '22 20:07 MSLukeWest

@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.

snickler avatar Aug 03 '22 14:08 snickler

Should be fixed in 1.1.4 according to release notes

dotMorten avatar Aug 12 '22 19:08 dotMorten

Yep, confirming, this was fixed in Microsoft.WindowsAppSDK v1.1.4:

Handy links:

gabbybilka avatar Aug 16 '22 16:08 gabbybilka

I'm still seeing this in 1.1.4 with VS17.4.0preview1 on ARM64: image

dotMorten avatar Aug 25 '22 20:08 dotMorten

FYI @evelynwu-msft

krschau avatar Sep 09 '22 11:09 krschau

@dotMorten If you're still getting this failure, please try a couple things:

  1. Update the project's Microsoft.Windows.SDK.BuildTools package reference to the latest (non-preview) version, 10.0.22621.1
  2. 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 avatar Sep 13 '22 19:09 MSLukeWest

@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.

dotMorten avatar Sep 13 '22 20:09 dotMorten