Getting Started with C# and Cross‑Platform .NET on a Mac

In my last post I covered building a cross-platform mobile game using Xamarin.Forms. The screenshots in that post were from Android but the best thing about Xamarin.Forms is the app will also run on other platforms without having to make changes. For example, here is what the same code base looks like when running on iOS 10.

Xamarin.Forms Emoji Flag Game 1

Xamarin.Forms Emoji Flag Game 2

Xamarin.Forms Emoji Flag Game 3

Note how the UI elements are native, so they have the expected look and feel. The flags are also different but this isn’t to do with Xamarin.Forms. As I’ve used emoji for the flags, they are rendered with the native system graphics. Apple have different images to Google for the same emoji, although Apple’s seem to be more well-known since WhatsApp have adopted their glyphs.

Code Editors

The above game simply used a Mac as a build and test agent, with the main development done in Visual Studio on Windows, but what if you want to develop in .NET on a Mac? There are a couple of major options and plenty of others that I won’t go into. For example, Unity does game scripting with an old version of Mono and Mono Develop has mainly been superseded by Xamarin Studio.

Xamarin Studio

Xamarin Studio logo

Xamarin Studio, perhaps unsurprisingly, focuses on developing Xamarin applications for iOS, Android and Mac. If you want to target Windows or Windows Phone then you are better off using Visual Studio.

Xamarin Studio with iOS Simulator

You can also use it to develop a web app in ASP.NET MVC. There are templates if you scroll down to the “Other” section.

Xamarin Studio ASP.NET MVC

However, this is an older version of the framework (MVC 5.2).

Xamarin Studio ASP.NET MVC 5.2 with Firefox

If you want to use the latest ASP.NET Core (aka MVC 6) then you are better off using the command line tools and a code editor, such as Visual Studio Code. At least until Xamarin Studio becomes Visual Studio for Mac.

VS Code

Visual Studio Code (VS Code) is not an IDE like Xamarin Studio or Visual Studio. It’s simply a code editor like Sublime, but a pretty good one at that.

It’s based on Electron so is effectively a desktop web app running in Chrome. However, it doesn’t feel as sluggish as Atom or Slack’s desktop app. It’s written in TypeScript, which is basically typed JavaScript.

Visual Studio Code 1.7.1

The latest version is 1.7.1, which fixes the issue where they almost overloaded npm. If you install the C# extension then you get step-through debugging and syntax highlighting, even in older projects created with other software.

Visual Studio Code 1.7.1 ASP.NET MVC

This version appears to have fixed the problem in previous releases where the Application Insights tracking would fire even if telemetry was turned off.

Visual Studio Code 1.7.1 Developer Tools

I plan to write a series of posts on building a simple app with .NET Core on Mac and Linux. So subscribe to the email list below if you are interested in hearing more about that.

If you want to learn how to make your web applications perform well (particularly when using ASP.NET Core) they you may like my book. Additionally, I’m available for hire.


This blog is treeware! If you found it useful then please plant a tree.
Donate a treeDonate a tree🌳🌳