Can I program in C# on a Mac?

86,411

Solution 1

Your first option is Microsoft Visual Studio for Mac which was released in 2017. If you're used to VS ide then I suggested you download this.

If not then you can have a look into MonoDevelop. You can download from here

MRE = Mono Runtime Environment

MDK = Mono Development Kit.

MDK = MRE + Extra tools, libraries, .NET PCL (Portable Class Library) profiles, etc.

If you have an application that you want to run that needs Mono you can install just the MRE.

If you are doing development, writing C# applications, whilst you can sometimes get away with just having the MRE installed, you may hit some missing features such as not having the .NET PCL profiles. So I would install the MDK if you are doing development. Reference

Solution 2

Yes, it is. Microsoft has released Visual Studio Code 2017. It works on Windows, Mac OS, and Linux; It is quite nice development text-editor. It works similar to the full-version, available on Windows - with a few draw-backs, and it will allow to write programs, as well as run and test them right on your Mac.

Microsoft Docs offer a quick getting started tutorial and a Hello World program out-of-the-box with the Visual Studio Code.

You will need to install a few dependencies, however. Which may sound kinda of obvious:

  1. Visual Studio Code
  2. .Net Core SDK
  3. C# extension from the marketplace.

I had good luck getting started and Visual Studio got all of the dependencies for me; so I simply went into the program, opened the integrated terminal (View > Integrated Terminal) and ran the command dotnet new console, and boom, a few seconds later I had a Hello World program, written in C#, running on my MacBook Pro.

Solution 3

There is now a Visual Studio for Mac available as a free community version as well as professional and enterprise versions by subscription.

JetBrains also has an IDE for C#, called Rider, that runs on the Mac. If you use IntelliJ or any of their other products you might like it - it feels better to me than MonoDevelop or Visual Studio for Mac. It is a commercial product but JetBrains offers very generous license terms (as in free) for students and open source projects. They also have a substantial discount for startups.

Solution 4

It is possible, but you won't be able to use Microsoft's tools, you'll need to use a third-party program like Xamarin Studio (MonoDevelop).

Edit

at the time of this answer there wasn't a Microsoft tool/IDE that could be used for developing .net / C# programs on a Mac. Now there are two:

  1. Visual Studio Code
  2. Visual Studio for Mac

Solution 5

Note that while everyone mentions Mono and Xamarin, which you should absolutely look into for C# development, Unity works on Mac directly, specifically Mac OSX 10.6+

while both use the C# language, some of the paradigms espoused by Unity are a little different from standard C# development. I personally recommend learning both.

ADDENDUM: Note that MS has recently announced that they'll be moving the standard .NET implementation cross-platform, and are doing so with the help of the Mono team, so while there's currently a confusing dual set of tools, it'll be shifting away from this in the future

Share:
86,411
firat
Author by

firat

Updated on November 07, 2021

Comments

  • firat
    firat over 2 years

    I want to learn C# for Unity and my personal computer is a MacBook Air. Can I program in C# on a Mac?