首页 > 解决方案 > Windows Forms Application to ARM64 (IOT)

问题描述

Is there a way to convert the project to UWP or should I use another approach? I need to deploy a Windows Forms Application written in C# with VS to Windows 10 IOT on a Raspberry Pi 3b. I've seen mention of a converter, but it seems it is used to publish the app to the Windows Store.

标签: c#wpfuwpraspberry-pi3arm64

解决方案


您需要将应用程序重写为 UWP 应用程序。您提到的转换器(桌面桥)将允许打包您的 Windows 窗体应用程序以存储部署到桌面系统,但不适用于 IoT。

Windows 10 IoT 不包括 WinForms 应用所依赖的 UI 堆栈。这记录在Windows 10 IoT Core 文档中(为您的方案添加了重点)

不支持旧版 Win32 UI:IoT Core 不包含用于创建经典 (HWND) Windows 的 API。CreateWindow() 和 CreateWindowEx() 等传统方法或任何其他处理 Windows 句柄 (HWND) 的方法均不可用。随后, IoT Core 不支持依赖于此类 API 的框架,包括 MFC、Windows 窗体和 WPF

如果您的 UI 和底层逻辑是分开的,那么您可以保留所有或大部分逻辑层(UWP 支持 .Net Standard 2.0)并使用 UWP 的 Xaml 堆栈重写 UI。


推荐阅读