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.
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.
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, 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.
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.
However, this is an older version of the framework (MVC 5.2).
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.
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.
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.
This version appears to have fixed the problem in previous releases where the Application Insights tracking would fire even if telemetry was turned off.
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.