Sunday, December 13, 2015

Visual Studio on Mac! It's possible

Well!
I have a mac , and it took me quite sometime to figure out how to start with c sharp on a mac.
I thought I should compile my understanding for making your life easier.

You have two options:
Buy a windows machine to get visual studio on it..just kidding :)
Install wondows as virtual machine on mac with partition and get visual studio on that.

Or , just stick to visual studio code and mono!

Install https://code.visualstudio.com/Download // this is going to make creation and editing of files very easy.

then install
http://www.mono-project.com/docs/about-mono/supported-platforms/osx/

Do not use brew for this one! use the official link posted above.
brew one works fine only if you are not using a form.


How to compile:


mcs filename.cs -r:System.Drawing.dll -r:System.Windows.Forms // the part -r onwards is optional depnding on you need the dll or not.

to run : 
mono filename.exe

mono also has debug options, which can be enabled using mono -debug filename.cs

Have a good day! 




No comments:

Post a Comment