简体   繁体   English

在使用 C# 制作的 Raspberry Pi 上运行一个 windows 表单应用程序

[英]Run a windows form application on Raspberry Pi made using C#

I neeed to run a windows form application on Raspberry Pi made using C#.我需要在使用 C# 制作的 Raspberry Pi 上运行一个 windows 表单应用程序。

I have tried the option of installing a windows os and running the exe application.我尝试了安装 windows 操作系统并运行 exe 应用程序的选项。 It does work but the issue is that it is slow and takes a lot of time for the application to work.它确实可以工作,但问题是它很慢并且应用程序需要花费大量时间才能工作。

Is there any possibility to run the exe directly on raspbian?有没有可能直接在raspbian上运行exe?

You can't natively run winform applications under Linux, but maybe you could try using Wine or one of the other compatibility tools for Linux.您不能在 Linux 下本地运行 winform 应用程序,但也许您可以尝试使用 Wine 或其他适用于 Linux 的兼容工具之一。

If you are the author of the application you could port your app to GTK# which is a desktop GUI Toolkit for Linux with C#如果您是该应用程序的作者,您可以将您的应用程序移植到GTK# ,这是一个使用 C# 的 Linux 桌面 GUI 工具包

What I'm using right now: You can execute Windows Forms Applications written in the .NET Framework (newest 4.8, no longer continued) with mono .我现在正在使用的是:您可以使用 mono 执行 Windows Forms 在.NET框架(最新的 4.8,不再继续)中编写的应用程序。 On the raspberry pi, if I recall correctly, you can " sudo apt install mono-complete " and then run it via the terminal: " mono YourApp.exe " As I said, it sadly only works with .NET Framework Applications (or maybe on rare occasions with .NET 6.0 too, hasn't worked for mine though), you may be able to change that in Visual Studio though (or new project and then copy/paste the code).在树莓派上,如果我没记错的话,你可以“ sudo apt install mono-complete ”然后通过终端运行它:“ mono YourApp.exe ”正如我所说,遗憾的是它只适用于 .NET 框架应用程序(或者可能在.NET 6.0 也很少见,虽然对我没有用),但您可以在 Visual Studio 中更改它(或新项目,然后复制/粘贴代码)。 The only downside is that you are then using an older version of C#, meaning some things may be different from what you are used to.唯一的缺点是您使用的是旧版本的 C#,这意味着有些事情可能与您习惯的有所不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM