My WinUI App is having problem running on x86 and ARM64 platforms

水 知 485 Reputation points
2026-07-23T07:52:25.3366667+00:00

I'm coding an app, it could work properly on x64 platforms. However, when I was trying to publish or debug with x84 and ARM64 presets, it keeps fail to run properly. I referenced H.NotifyIcon and CsWin32, I'm not sure if this problem was triggered by one or more of them or my code.

When debug with x86 preset, IDE show exception in H.NotifyIcon.Core.WindowUtilities. When publishing with ARM64 preset, IDE show error Assets file 'D:\WorkspaceExpander\WorkspaceExpander\obj\wappublish\win-arm64\project.assets.json' doesn't have a target for 'net8.0-windows10.0.19041.0'. Ensure that restore has run and that you have included 'net8.0-windows10.0.19041.0' in the TargetFrameworks for your project.

Windows development | WinUI
0 comments No comments

Answer accepted by question author
Danny Nguyen (WICLOUD CORPORATION) 8,725 Reputation points Microsoft External Staff Moderator
2026-07-23T08:38:54.36+00:00

Hi @水 知 ,

I see the issue is with x86 debugging exceptions and missing ARM64 publishing targets. I suspect this is related to project configuration and cached build files, as my tests with a sample WinUI app using H.NotifyIcon and CsWin32 succeeded on both platforms.

I recommend trying these quick steps to refresh your project setup:

  1. Clear your NuGet cache and restore the project. Run these commands in your terminal from your project folder:
dotnet nuget locals all --clear
dotnet restore -r win-arm64
  1. Update your .csproj file to explicitly include the required platforms and frameworks. Please ensure you have properties similar to this:
<Platforms>x86;x64;arm64</Platforms>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>

If the issue persists, I want to request a bit more targeted evidence to help pinpoint the root cause:

  1. What is the exact error message and full stack trace you see when the x86 debugging fails?
  2. Could you share the contents of your .csproj file (removing any sensitive information)?

If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.

Thank you.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Oldest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.