C# .NET Core


This entry is part 4 of 10 in the series C# Getting Started

The .NET Framework was originally released in 2002. The .NET Framework was created principally for developing applications to be used on computers (both server and client workstations) running the Windows operating system. However, both Unix and Apple managed to cut into Microsoft’s market share in computers. There has been a huge shift toward mobile devices, and an increase in the share of web-based applications rather than desktop-based applications. These things prompted the development of .NET Core.

Microsoft concluded that it needed a cloud-enabled, cross-platform, open source derivative of the .NET Framework. It labeled that new framework .NET Core. At about the same time, Microsoft acquired Xamarin to address development on mobile platforms such as Android and iOS. You can use the C# language whether you will be developing full .NET Framework applications, .NET Core applications, or Xamarin applications.

Versions

.NET Core 1.0 was released in June 2016 followed by version 1.1 in March 2017. .NET Core 2.0 was released on in August 2017. .NET Core 2.1 was released on May 30, 2018. Version 3.0 is in development at the time of the writing of this post (December 2018). .NET Core is to to stay for a while and it is the platform of choice for web (ASP.NET Core) and Universal Windows Platform application development. At the same time, .NET Core is also one of the best options for developing applications designed to run on Linux or macOS.

Multiplatform Support

.NET Core brings us closer to the goal of “write one, run everywhere”. We’re not there yet, because if you want to run your program on Linux or macOS you need to make some minor modifications. Visual Studio Code is an integrated development environment (IDE) created by Microsoft that can run on Linux, macOS, and Windows.

Fast and Easy Upgrades

.NET Core is highly modular, and upgrades can be performed automatically via NuGet packages. Today, applications are typically designed in a modular fashion so that different components can be independently upgraded without requiring the entire application to be replaced. When we write C# programs, one of our goals is to write loosely coupled code so that when we need to modify code or add a new feature, we don’t need to re-compile and re-deploy the whole application. This concept applies to classes we create and use, as discussed in the post C# Class Association.

Smaller, Simpler and Fewer Version Issues

.NET Framework, which now contains more than 20,000 classes, must be installed in its entirety both on any development workstation and on each application user’s computer. Packages are libraries of code that provide certain units of functionality. The distribution of .NET Core is based on NuGet packages. Packages are stored in the NuGet Gallery from which they are downloaded as needed. So your footprint is smaller because you only include what you need.

What about versioning issues? Every .NET Core application can have its own copy of the .NET Core libraries. The .NET Core framework can be distributed side by side with the application code.

Open Source

Open source software can be seen by anyone with the appropriate tools in order to understand what might be causing a bug. Developers can either fix the bug or modify their own code that interacts with that code to avoid undesirable results.

Better Application Performance

.NET Core apps can be precomplied to native code on Windows, Linux, or macOS. Sometimes this can result in significant improvements in application performance.

Remove Obsolete Elements

.NET Core is a new framework based on .NET Framework. With .NET Core Microsoft is able to decouple obsolete and legacy elements and tailor .NET Core to today’s environment.

Xamarin

Xamarin is a platform that permits the development of native Android, iOS, and Windows applications using C# and the .NET libraries. On a PC, Xamarin development takes place within Visual Studio (after additional features have been enabled). On a Mac, development is done using Visual Studio for Mac, the successor to Xamarin Studio. Regardless of IDE and whether the targeted platform is Android, iOS, or Windows, the development language will be C#.

In 2016, Xamarin was acquired by Microsoft, and subsequently Xamarin has been bundled with Visual Studio. Even the Community (free) edition of Visual Studio includes Xamarin. The Xamarin SDK is now open source. Microsoft refers to Xamarin as “.NET cross-platform mobile.”

In Visual Studio 2017, verify that Xamarin is installed by clicking the Help menu. If Xamarin is installed, you should see a Xamarin menu item. If not you can install Xamarin by first running the Visual Studio Installer.

Series Navigation<< .NET IntroductionC# Console Hello World >>