1

I've written a C# program on Visual Studio 2015, and I would like to be able to run it on Mac, and possible Linux. Is this possible?
I realise that when compiling a project from Xamarin on Mac, it's exported as a .exe, so would running the .exe compiled on Windows be runnable on Mac?
And if not, how would I make it be?

It doesn't matter if a single .exe can't be cross platform, so long as I can compile for both OS's.
Also, it doesn't matter if it actually is a .exe, so long as it can be run.

Would I be required to actually compile my C# project on a mac?

Jacob Garby
  • 773
  • 7
  • 22
  • With **mono** run-time installed on your Mac, you may run exe files generated by Visual Studio. However, you may need to introduce in your c# code some conditional compile directives to adress compatibility issues. – Graffito Dec 24 '16 at 15:43
  • Go to http://dot.net and you will see what's recommended by Microsoft. – Lex Li Dec 25 '16 at 03:06

1 Answers1

2

Try to run the exe in Mac by using mono:

/Library/Frameworks/Mono.framework/Versions/Current/bin/mono --runtime=v4.0 [path-to-your-exe]
lowleetak
  • 1,362
  • 1
  • 10
  • 19