如何在Visual Studio中编译C#应用程序以在Mac OSX上运行 [英] How to compile a C# application in visual studio to run on Mac OSX

查看:954
本文介绍了如何在Visual Studio中编译C#应用程序以在Mac OSX上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我做了一个C#应用程序,我想让它在MacOSX中运行。那可能吗?我该怎么办?



该程序是用VisualStudio C#制作的。

解决方案





下面的段落(缩进)最初是为了回答问题的第一个版本而写的,后来由询问者确定:



扩展意味着什么都没有。从本质上讲,没有扩展这样的东西。它曾经是过时的Microsoft系统的概念,但现在这只是一个惯例。如果更改文件名(。exe只是文件名),则Window shell不会识别它,但您仍然可以以编程方式启动应用程序。文件的功能由其内容定义,而不是名称。



在Mac OS X和其他* NIX(类Unix)系统上,可执行文件可以有任何文件名,。exe或不。
[结束编辑]



现在,有一种方法可以运行.NET许多平台上的应用程序,仅限于.NET FCL的某些标准子集,BCL +一些非标准库的应用程序,但有一些限制。 Windows和Mac常见的产品是Mono,另一种CLR实现:

http:/ /en.wikipedia.org/wiki/Mono_%28software%29 [ ^ ],

http://www.mono-project.com/ [ ^ ]。



使用Mono,您可以在Windows上开发应用程序并在Mono(Windows或其他平台)上运行而无需重新编译。它在Linux上运行得更好,并且可以工作但是在Mac上用户界面看起来很陌生。如果您想遵循正宗的Mac的UI规则,您将需要在Mono上安装的其他项目 - 注意! - 取代Mono的运行时命令行:

http://en.wikipedia.org/wiki/Monobjc [ ^ ],

< a href =http://www.monobjc.net/> http://www.monobjc.net/ [ ^ ]。



您还可以开发标准的Mac OS X安装包。



但是有了这样的用户界面,你需要用真正的Mac OS X系统进行大部分开发。



-SA

Hello

I made a C# application and i want it to work in MacOSX. Is that possible? And how can I do it?

The program is made in VisualStudio C#.

解决方案

[EDIT]

The paragraph below (indented) was initially written in response to first version of the question, which was later fixed by the inquirer:

The extension means next to nothing. Essentially, there is no such thing as "extension". It used to be a notion of obsolete Microsoft systems, but now this is mostly just a convention. If you change file name (".exe" is nothing but a file name), the Window shell wont recognize it, but you still can start the application programmatically. The function of a file is defined by its content, not name.

On Mac OS X, and other *NIX (Unix-like) systems, an executable file can have any file name, ".exe" or not.
[END EDIT]

Now, there is a way to run .NET applications on many platforms, for the applications limited to some standard subset of .NET FCL, BCL + some non-standard libraries, with some limitations. The product common for Windows and Mac is Mono, an alternative CLR implementation:
http://en.wikipedia.org/wiki/Mono_%28software%29[^],
http://www.mono-project.com/[^].

With Mono, you can develop applications on Windows and run on Mono (Windows or other platforms) without re-compliation. It works better on, say, Linux, and works but the UI looks quite foreign on Mac. If you want to follow authentic Mac's UI rules, you will need additional project which is installed on top on Mono and — attention! — replaced Mono's runtime command line:
http://en.wikipedia.org/wiki/Monobjc[^],
http://www.monobjc.net/[^].

You can also develop standad Mac OS X installation packages.

But with such UI, you will need to do a big part of development with real Mac OS X system.

—SA


这篇关于如何在Visual Studio中编译C#应用程序以在Mac OSX上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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