.net核心跨平台桌面应用 [英] .net core cross platform desktop app

查看:887
本文介绍了.net核心跨平台桌面应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用.net Core开发一个跨平台的桌面应用程序。该应用程序需要在Linux,Mac OS和Windows上执行。为此,我是否应该创建一个控制台应用程序并将其放置在设置xml中的行下方?

I'd like to develop a cross platform desktop app by using .net Core. The app needs to be executed on linux, mac os, and windows. For that purpose, should i create a console app and put below lines in settings xml?

<PropertyGroup>
   <RuntimeIdentifiers>win10-x64;osx.10.12-x64;debian.8-x64</RuntimeIdentifiers>
</PropertyGroup>

是否足够?如果是这样,我应该编写所有平台并用逗号分开吗?

Will it be sufficient? If so, should i write all platforms and separate by comma e.g.


win7-x32; win10-x64; ...

win7-x32;win10-x64;...

如果不是答案,我如何使用.net Core生成跨平台桌面应用程序?

If it is not the answer, how can i generate cross platform desktop app with .net Core?

推荐答案

正如其他答案所难免的那样,.NET Core本身是跨平台的,但是它不提供任何GUI解决方案。您可以运行控制台/终端应用程序以及Web应用程序,但不能运行桌面应用程序。

As the other answer eludes to, .NET Core itself is cross platform, but it doesn't offer any GUI solution. You can run console/terminal applications, as well as web applications, but not desktop applications.

到目前为止,还没有解决多平台GUI的正式Microsoft技术。我知道的两个是 Avalonia Eto.Forms 。两者都有各自的优缺点,而且都属于越野车。并不是从某种意义上说,它是不可用的,而是在它正在发展着的技术上,不要指望它们使您立即摆脱困境。

As of right now, there is no official Microsoft tech that solves a multi platform GUI. The two that I know of are Avalonia and Eto.Forms. Both have their pro's and cons, and both are kinda buggy. Not in the sense that it's unusable, but in the sense that it's evolving tech, don't expect them to blow your mind right off the bad.

入门指南:

  • Avalonia - http://avaloniaui.net/guides/quickstart
  • Eto.Forms - https://dotnetcoretutorials.com/2018/03/19/cross-platform-winforms-kinda/

这篇关于.net核心跨平台桌面应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆