What’s the Difference Between .NET Framework, .NET Core, & Xamarin?

by | Jun 25, 2019

According to the TIOBE Index, Microsoft’s C# language is the sixth most popular programming language in the world. Indeed, for enterprise applications, the competition boils down to either Java or C# over the past 20 years.

Along with C#, Microsoft supports the .NET libraries and runtimes for C#. If you’re new to C# development and the Microsoft ecosystem, then the distinctions between Microsoft’s .NET Framework, .NET Core, and Xamarin can be confusing.

In this post, we’ll look at the differences between these options for C# development. Furthermore, we’ll help you pick the .NET version that makes sense for your project.

The Microsoft C# Ecosystem

C# is a strongly-typed, object oriented language that borrows heavily from C syntax and Java’s features. At first, the language was seen as an upgrade of C and C++. It offered better support for class libraries and gave Microsoft greater control over the syntax for their object-oriented programs. Microsoft first announced C# in 2000.

At the same time, Microsoft was already developing the .NET project to create a common runtime and class library for Windows programs. Significantly, .NET has become the leading implementation of the C# language. However, .NET is technically language-neutral. In fact, it includes Common Language Infrastructure that allows .NET to expand to support other languages. Still, .NET and C# are very closely tied. Very likely, if you’re working in a Microsoft dev shop, you’re writing .NET applications in C#.

No matter the programming language, the code gets compiled and evaluated in a software context known as the Common Language Runtime (CLR). The CLR is the main advantage of the .NET ecosystem. In addition, the .NET ecosystem includes a standard Framework Class Library (FCL) for built-in common functions.

Moreover, there are multiple implementations of the .NET runtime and libraries. Overall, these various implementations make sense depending on the context in which your application will deploy. At this time, .NET Framework, .NET Core, and Xamarin are the current options for using the Microsoft CLR and FCL.

.NET Framework

The .NET Framework is the oldest implementation of the Common Language Runtime. In short, it is the Windows-only implementation of .NET that is the base for many existing applications. As a result, the .NET Framework has a host of tools and third-party libraries already in existence. Additionally, many existing .NET applications are already written on the .NET Framework.

Microsoft recommends using .NET Framework when your existing application already uses it or when you need access to .NET Framework-only third-party libraries. Furthermore, some features of .NET Framework itself are not available in .NET Core yet. For instance, some applications of ASP.NET, Visual Basic, and F# aren’t yet supported in .NET Core.

.NET Core

.NET Core is the latest version of the CLR and the currently preferred option. It’s a slimming down of the .NET Framework with greater accessibility for various devices.

Whereas .NET Framework was Windows-only, .NET Core is cross-platform and can deploy applications on Mac or Linux. In addition, Microsoft Azure cloud infrastructure offers the most support for .NET Core applications. Because they’re lighter weight than .NET Framework applications, .NET Core is faster and more scalable. Indeed, .NET Core applications can deploy easily as microservices on Azure. They also deploy well inside containers like Docker.

If you’re starting a new project, you likely should use .NET Core. Even if you’re extending an existing .NET Framework app, you can add .NET Core gradually as you build new features.

Xamarin

Xamarin is not technically a .NET option. Instead, it runs on top of Mono, an earlier cross-platform version of .NET that Microsoft built before deciding to go with .NET Core. Xamarin is a mobile-only implementation. If you’re planning to write a mobile app for Android or iOS, then Xamarin is how you deploy C#, Visual Basic, F#, etc on mobile platforms. In fact, Xamarin is your only option for those languages on mobile.

Choosing Between the .NET Options

From an architecture perspective, the .NET Framework ships with the Windows operating system. So, it’s already there for you to use in its entirety if you’re on a Windows machine. In contrast, .NET Core is a lightweight version of the CLR that ships along with the application and can work cross-platform. Similarly, Xamarin also ships alongside the application when running on mobile.

While there are scenarios where you might choose .NET Framework, .NET Core is undoubtedly the future if you want cross-platform support or applications that can run in containerized and/or microservice infrastructure.