針對 ARM UWP 應用程式進行疑難排解Troubleshooting ARM UWP apps

如果您的 ARM32 或 ARM64 UWP 應用程式在 ARM 上無法正常運作,以下是一些可能有所説明的指引。If your ARM32 or ARM64 UWP app isn't working correctly on ARM, here's some guidance that may help.

注意

若要建立您的 UWP 應用程式,以原生的 ARM64 平臺為目標,您必須有 Visual Studio 2017 15.9 版或更新版本,或 Visual Studio 2019。To build your UWP application to natively target the ARM64 platform, you must have Visual Studio 2017 version 15.9 or later, or Visual Studio 2019. 如需詳細資訊,請參閱這篇部落格文章For more information, see this blog post.

常見問題Common issues

以下是針對 ARM32 和 ARM64 應用程式進行疑難排解時,應謹記在心的一些常見問題。Here are some common issues to keep in mind when troubleshooting ARM32 and ARM64 apps.

在 ARM 處理器上使用僅限 Windows 10 行動裝置版 APIUsing Windows 10 Mobile-only APIs on ARM-based processors

使用僅限行動裝置的 Api 時,ARM 應用程式可能會遇到問題 (例如, HardwareButtons) 。ARM apps may run into problems when using mobile-only APIs (for example, HardwareButtons). 若要減輕此問題,您可以在呼叫這些 API 之前動態偵測您的應用程式是否正在 Windows 10 行動裝置版上執行。To mitigate this, you can dynamically detect whether your app is running on Windows 10 Mobile before calling these APIs. 請依照部落格文章利用 API 協定動態偵測功能中的指引。Follow the guidance in the blog post, Dynamically detecting features with API contracts.

包括 UWP 應用程式不支援的相依性Including dependencies not supported by UWP apps

通用 Windows 平臺 (UWP) 未以 Visual Studio 正確建立的應用程式,而 UWP SDK 可能相依于 ARM64 系統上執行的 ARM 應用程式無法使用的作業系統元件。Universal Windows Platform (UWP) apps that aren't properly built with Visual Studio and the UWP SDK may have dependencies on OS components that aren't available to ARM apps running on an ARM64 system. 這些相依性的範例包括:Examples of these dependencies include:

  • 預期 .NET Framework 組件可供使用。Expecting parts of the .NET Framework to be available.
  • 參考與 UWP 不相容的第三方.NET 元件。Referencing third-party .NET components that aren't compatible with UWP.

這些問題可透過下列方式解決:移除無法使用的相依性,並使用最新的 Microsoft Visual Studio 和 UWP SDK 版本重建應用程式;或者,作為最後的手段,從 Microsoft Store 移除 ARM 應用程式,以便將應用程式的 x86 版本 ((如果有) 的話)下載到使用者的電腦。These issues can be resolved by: removing the unavailable dependencies and rebuilding the app by using the latest Microsoft Visual Studio and UWP SDK versions; or as a last resort, removing the ARM app from the Microsoft Store, so that the x86 version of the app (if available) is downloaded to users’ PCs.

如需適用於 UWP 應用程式的 .NET API 的詳細資訊,請查看適用於 UWP 應用程式的 .NETFor more info on .NET APIs available for UWP apps, see .NET for UWP apps

使用舊版 Visual Studio 和 SDK 編譯應用程式Compiling an app with an older version of Visual Studio and SDK

如果發生問題,請務必使用 Microsoft Visual Studio 和 Windows SDK 的最新版本編譯應用程式。If you're running into issues, be sure to use the latest versions of Microsoft Visual Studio and the Windows SDK to compile your app. 使用舊版 Visual Studio 和 SDK 編譯的應用程式,可能會有在較新版本中已修正的問題。Apps compiled with an earlier version of Visual Studio and the SDK may have issues that have been fixed in later versions.

偵錯Debugging

您可以使用現有的工具來開發 ARM 平臺的應用程式。You can use existing tools for developing apps for the ARM platform. 以下是一些實用的資源。Here are some helpful resources.

  • Visual Studio 15.5 Preview 1 及更新版本支援使用通用驗證模式執行 ARM32 應用程式。Visual Studio 15.5 Preview 1 and later supports running ARM32 apps by using Universal Authentication mode. 這會自動啟動必要遠端偵錯工具。This automatically bootstraps the necessary remote debugging tools.
  • 若要深入了解 ARM 上偵錯的工具和策略,請參閱ARM64 上的偵錯See Debugging on ARM64 to learn more about tools and strategies for debugging on ARM.