macos .NET 应用程序到 Mac OS X 应用程序?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1745525/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:32:39  来源:igfitidea点击:

.NET application to Mac OS X application?

.netvisual-studiomacos

提问by lab12

Is there a way to convert .NET applications into Mac OS X applications? I am using Visual Basic 2008, and I want Mac users to use my application as well. Is it possible? If so please reply back with a link or source.

有没有办法将 .NET 应用程序转换为 Mac OS X 应用程序?我使用的是 Visual Basic 2008,我希望 Mac 用户也使用我的应用程序。是否可以?如果是这样,请回复链接或来源。

回答by Benjamin Pollack

The answer depends strongly on what you are attempting to do.

答案在很大程度上取决于您尝试做什么。

The Mono Projectallows you to run CLR-based applications on OS X. Mono's libraries, however, are not complete replicas of those on the official Microsoft .NET runtimes, and it's quite easy to make software that runs fine on Windows but fails miserably on Mono. The Mono Migration Analyzer, also known as MoMA, is a tool you can run against your .NET assemblies to learn whether they will run on Mono, and, in rough terms, how well.

Mono项目允许你在OS X上Mono的库运行基于CLR的应用程序,但是,是不是那些官方的Microsoft .NET运行时的完整副本,并且它很容易使软件在Windows上运行正常,但悲惨的失败了上单核细胞增多症。该单迁移分析器,也被称为现代艺术博物馆,是可以运行对你的.NET程序集,了解他们是否会在Mono运行,并且,在恶劣的条件,如何的工具。

One place where you're almost certainly going to get hit, given that you are writing a VB.NET application, is the GUI libraries. WinForms requires X windows on Mac, which is not installed by default. While Mono provides some facilities for making native GUIs using .NET, doing so would require rewriting your user interface more or less from scratch--and the main project to do that, Cocoa#, seems quite dead at the moment.

考虑到您正在编写 VB.NET 应用程序,您几乎肯定会遇到的一个地方是 GUI 库。WinForms 在 Mac 上需要 X windows,默认情况下不安装。虽然 Mono 提供了一些使用 .NET 制作本机 GUI 的工具,但这样做需要或多或少地从头开始重写您的用户界面——而主要项目Cocoa# 目前似乎已经死了。

So, basically: if your application is not a GUI application, your chance of being able to run on Mac is probably fairly high. Otherwise, it'd probably be worth putting your efforts elsewhere.

所以,基本上:如果您的应用程序不是 GUI 应用程序,那么您能够在 Mac 上运行的机会可能相当高。否则,可能值得将您的努力放在其他地方。

回答by Hannoun Yassir

You might try Mono. It runs on Windows, Linux and Mac OS.

你可以试试 Mono。它可以在 Windows、Linux 和 Mac OS 上运行。