Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more: , +
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#.
Posted
Updated 7-May-15 13:10pm
v2

1 solution

[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
 
Share this answer
 
v2
Comments
Sascha Lefèvre 7-May-15 20:20pm    
Good explanation, 5ed.
I would additionally hint at:
http://www.mono-project.com/docs/about-mono/compatibility/
http://www.mono-project.com/docs/tools+libraries/tools/moma/
Sergey Alexandrovich Kryukov 7-May-15 20:37pm    
I know. Thank you for the important point, Sascha.
—SA
Matt T Heffron 7-May-15 20:32pm    
+5(OP edited the original question to remove references to "exe" so this solution NOW looks like you've pulled the "exe" context out of ...)
Sergey Alexandrovich Kryukov 7-May-15 20:38pm    
Thank you, Matt.
Well, now I'll need to add some disclaimer on "extension" part. :-)
—SA
Sergey Alexandrovich Kryukov 8-May-15 10:47am    
You did not get it. "that exe doesn't work in Mac" is not what I told you. You can actually compile some .NET code on Windows and execute it on Mac OS X under Mono. Please read my answer thoroughly and learn the topic, then ask your follow-up questions.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900