In this post we're going to talk about one of the misconceptions circulating online.
Today, we'll see if you can program in C# on Mac, and what my opinion and experience is after using a Mac as my main device for several months.
Table of Contents
1 - Is .NET supported on Mac?
First of all, let's talk about whether we can install .NET or not on our machine, and just like we saw in the post about developing .NET on Linux: Yes, programming on a Mac is totally possible, so long as you're not working in .NET Framework. Since the release of .NET Core, we can run C# and F# code on Mac.
I won't dwell on this too much—if you want to install .NET on Mac, you can get the installer on the official Microsoft site.
And of course, the rest of the applications we typically use for development, like Docker, Git, etc., work without any issues.
1.1 - Apple silicon vs Intel
One thing I want to highlight is the difference between Apple silicon processors, like M1 and M2, and Intel processors.
Most C# libraries were developed on Windows computers, or Macs from before 2021, meaning they use x64 (or x86) processors—either Intel or AMD. The point here is that these are different architectures, and some libraries might not have support for Apple silicon. That's not as common now in 2023, but I personally had that issue with a couple of libraries when I was working in Ruby.
2 - Developing C# applications on Mac
At this point, F# could be included, but I personally don't work with it, and as you know I only speak from my own experience, so in my case, I'll focus on C#.
I have to say, at first I had no issues, neither with the CLI nor running the IDE. In fact, not only that, all the content on my YouTube channel from the last two months has been created on a Mac—including the code, video recording, and video editing.
In this post, I'm not going to explain how to create an application on Mac, because it's just like Windows and there are other courses for that. What I will do is talk about the different IDEs we have for programming .NET on a Mac.
2.1 - Visual Studio on Mac
First off, let's look at the official version of Visual Studio for Mac from Microsoft.
Honestly, it works, but it's really ugly—and while it's not super important for it to look nice, there should be a minimum standard of quality. I honestly don't understand how someone could program here, but anyway.
Then, it's missing a lot of features that Visual Studio for Windows has. I don't even want to bring up plugins, because there are none—not even Copilot, which Microsoft has been pushing hard.
But even basic things are missing. For example, when you run a test and it passes or fails, in Visual Studio for Windows you get a green tick or a red X next to the test. In VS for Mac, there's nothing—only if you open the (also very ugly) tests tab.
Another detail, not super important but worth mentioning—as you can see all projects have the same icon, and it's not able to differentiate between types. For example, you can't run tests by right-clicking on the test project.
Everyone can do what they want of course, but I don't recommend programming in Visual Studio for Mac even for a minute.
2.2 - Programming C# with Visual Studio Code on Mac
From the time I started using the Mac as my day-to-day laptop until now, only two months have passed. And in those two months, things have changed in Visual Studio Code (both on Mac and Windows);
Two months ago, I would've said it's impossible to do anything with Visual Studio Code—and while it wasn't truly impossible, it was kind of miserable, let's be honest. Today, things are very different. Let me explain.
Until recently, we had a C# extension from Microsoft:
With this extension, we can simply open a project as a folder and work on it.
The extension gives us Intellisense (autocomplete and suggestions), lets us run tests, etc. It isn't as full-featured as Visual Studio, because you have to use the CLI quite a bit for tasks like building, but it works.
What happened recently (June 2023) is that we now have another extension: C# Dev Kit. Honestly, I could write an entire post just about this extension.
- Note: This will also install Intellicode, which you can remove manually, but it's nice to have.
With this extension, Visual Studio Code can open a project as a .NET project inside the IDE itself, and Visual Studio structures it just like the IDE would, with all the projects.
And here, you have full control with right-click, which means it treats it as a project—you can build, clean, add projects, etc.
There are still a few things missing, like the project-type detection I mentioned (such as right-clicking to run all tests), but it has a test explorer that's pretty good, and now it does show in the IDE when a test has passed:
The current version is a preview, and when they release version 1.0 officially, I'm convinced it will be way better than Visual Studio for Mac. In fact, for me, it already is—and from what I've tested, I'm honestly very happy with it.
As a final note, C# Dev Kit has the same license as Visual Studio, so if you're a student, teacher, or doing open source, you don't need to pay, but if you're a company making a profit from it, then you do.
2.3 - Programming with Rider on Mac
And finally, the last IDE available for C# development on Mac: JetBrains Rider. Personally, it's my favorite IDE, and before anyone says this is sponsored—it's not (I wish it was!).
I've been using it for years, not just in my YouTube videos, but at work too, and in my opinion it's the only "real" IDE on Mac. On Windows, you could argue newer versions of Visual Studio can compete with Rider, but on Mac, there's no debate.
It's a complete IDE that's not missing anything—actually, it's even more complete, plus it's cheaper than Visual Studio Enterprise. For instance, the Pro version of Visual Studio doesn't have code coverage, so to get all Rider's features in VS, you need Enterprise.
But anyway, this isn't a post to compare Rider and Visual Studio Code, since right now they're at different levels.
3 - My Experience Using Mac as My Daily Driver for C#
Now we're getting into the part where I'm just giving my opinion. And I'm going to say two things that contradict each other.
Here's the reality: I've loved working with the Mac. When I left the startup, they gave me the Mac I'd been using—a 2021 16" Macbook Pro M1. Honestly, it's a great machine:
But I'm going back to Windows, and there are two reasons: First, I use Windows at work and, while it's true I don't share files or anything between devices, I work remotely and have one keyboard and mouse for both machines. The Mac keyboard works slightly differently than Windows, for example with control and accents, which can be a little tedious at times.
Second, my plan is to sell this laptop, which as I said runs amazingly well, and invest the money in a desktop with tons of RAM and a new processor. Plus, I still have my Razer Blade 2019, which was my laptop before the Mac.
I'll also mention that this is the second time I've had a Mac—the other time was from 2011 to 2019 (when I bought the Razer) and I sold that one for €500. In the end, they're great machines and last a long time.
I could go on about what I liked more and less about the Mac—for example, MacOS is still trash and the Mac's battery is amazing: I get over 8 hours with Rider and Docker running. But that's not the point here, and I think with everything I've mentioned, you get an idea of what it's like to work on a Mac.
So yes, you can absolutely program C# applications on a Mac, and it works really well.
If there is any problem you can add a comment bellow or contact me in the website's contact form