Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I program in C# on a Mac?

Tags:

c#

macos

unity3d

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

like image 933
firat Avatar asked Feb 02 '15 14:02

firat


People also ask

Is C good for programming?

C is the language where you can find the basis for these concepts. Hence, it is the best language for those who are new to programming. C programming language uses blocks to separate pieces of code performing different tasks. This helps make programming easier and keeps the code clean.

Can Python be written in C?

To write Python modules in C, you'll need to use the Python API, which defines the various functions, macros, and variables that allow the Python interpreter to call your C code. All of these tools and more are collectively bundled in the Python. h header file.

Can I make app with C?

C/C++ Google provides two official development kits for making Android apps: the SDK, which uses Java, and the NDK, which uses native languages like C and C++. Note that you cannot create an entire app using C or C++ and zero Java.


3 Answers

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

like image 195
Izzy Avatar answered Oct 13 '22 08:10

Izzy


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.

like image 20
Sam Avatar answered Oct 13 '22 10:10

Sam


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.

like image 8
dlu Avatar answered Oct 13 '22 09:10

dlu