Introduction of .NET framework
Even though Microsoft announced the .NET Core 2.0, programmers are still not very clear about the differences between .NET Core, .NET Standard, Xamarin, and the .NET Framework. In this article we will explore the differences and the relevance of each platform.
.NET Framework was developed by Microsoft in the early 2000s to build Web and Desktop applications for Windows. A .NET programmer needs to be proficient in C#, Visual Basic, and F# as the applications are written in these languages.
.NET Framework consists of two major components:
Common language runtime (CLR) –
.NET provides a run-time environment, called the common language runtime that runs the code and handles the execution of applications. It also provides services that make the development process easier. Compilers and tools expose the common language runtime’s functionality and enables the programmer to write code that benefits from this managed execution environment.
Base Class Library (BCL) –
The BCL provides the most foundational types and utility functionality and is the base of all other .NET class libraries. It also provides a library of tested and reusable code that developers can use in their applications. Since apps often prefer a particular policy, such as low-latency to high-throughput or low-memory to low-CPU usage, the BCL takes a middle-ground approach according to these various performance concerns. BCL is intended to be high-performance.
What is .NET Core?
As we have seen, over the years since the 1990s .NET evolved a lot. There was a time when applications were limited to .NET framework and server-desktop architecture only, but the inclusion of mobile phones, smart devices played a huge role in bringing .NET technology to where we see it today, and it has adopted the open source path. Microsoft .NET framework has upgraded itself to Xamarin platform after the company was acquired by the IT giant.
While supporting cross platform development including UWP (Universal windows platform), android and iOS, gradually .NET moved from Xamarin to .NET Core which was a unique framework where cross operating system (OS) development is possible. .Net programmers were not limited to developing applications only for the Windows OS; they developed cross-functional apps for Windows, Macintosh and Linux. There is some set of API (Application Programming Interface) that supports all these frameworks or all .NET flavors.
What is .NET Standard?
Microsoft .NET Standard is the set of API that is available on all .NET implementations. Each implementation of the managed framework has its own set of BCL, which contains classes such as exception handling, strings, XML, I/O, networking, and collections. It will create some type of uniformness, a portability that supports .NET Core, Xamarin and .Net Framework. Basically, it is the set of BCL that supports a wide range of technologies like .NET Framework, .NET Core, MONO, Xamarin, Mac, Android, UWP, Windows Phone etc.
The relationship between .NET Standard and a .NET implementation is the same as the relationship between the HTML specification and a browser. The latter is an implementation of the former, and for a user, only the final application on which he/she is working matters.
Hence, the .NET Framework, Xamarin, and .NET Core each implement .NET Standard for the BCL in their managed framework. Since the IT industry will evolve even in the future and will continue to introduce new hardware and OS, there will be new managed frameworks for .NET in the years to come. However, the developers rely on the consistent set of APIs that can be tweaked and used in the .NET framework anywhere.
Why We Need .Net Standard?
In last few years as we know, dot net development extended its capability beyond windows OS and platforms. It spread its wings and evolved into .NET Framework, .NET Core and Xamarin, and some base libraries were created to support them, These base libraries are built upon CLR that are supported by compilers and languages.
Now, we can see .NET framework, .NET Core and Xamarin have their different base libraries that reside on CLR but the .NET programmers needed to learn all these base libraries as there was no single platform to run and support all of these. If we take an example of .NET compact framework which was developed in early of 2000’s to support phones, but no common libraries existed for it. We find the same problem even with mono. Due to these multiple .NET frameworks, developers needed to take the support of different base libraries. Here .NET Standard came into picture as it creates a common layer to access all these .NET flavors.
What is Portable Class Library?
The Portable Class Library (PCL) project enables the programmer to write and build managed assemblies that work on more than one .NET Framework platforms. The developer can create classes that contain code they wish to share across many projects, such as shared business logic, and then reference those classes from different types of projects.
Microsoft .NET standard library provides a common, uniform layer and set of API that supports all .NET flavors. PCL supports APIs more than platforms, and hence the programmers need to re-compile applications to support PCL. But as .NET Standard supports more platforms, hence there is no need for the programmers to re-compile applications.
Is .NET Standard the alternative to PCL?
.NET Standard libraries are no different than PCL libraries except that they put a layer over the top of a different standardized set of APIs, and those APIs may implement different pointers. Microsoft had announced in one of its blogs in 2016, that .NET Standard will replace PCLs as the tooling story for building multi-platform .NET libraries.
.NET Standard vs Portable Class Libraries
In Microsoft .NET development we can think of .NET Standard as another .NET Framework, except that we use it to develop class libraries only. Microsoft .NET Standard is a successor of the portable class library.
PCLs used a union of the common APIs that a platform supported. Hence, the more platforms it supported, the fewer APIs were available. It was then difficult to understand what APIs were actually supported for a given combination of platforms. With a new platform, the existing PCLs would have to be recompiled. PCLs also required Microsoft to create a new framework implementation fork for each platform. Since .NET Standard fixes the API, rather than an implementation, there is no need to recompile an application.
For a layman to understand, .NET Standard is a set of curated APIs, picked by Microsoft, whereas PCLs are not.
.NET Core and .NET Standard: What Is the Difference?
As we have discussed above, .NET Standard is a specification of APIs that all .NET implementations must provide. It brings consistency to the .NET family and enables the programmer to build libraries they can use from any .NET implementation. It replaces PCLs for building shared components. The company clarified this in their own blog.
.NET Standard is a specification which dictates what the BCLs of different .Net platforms should implement to unify the BCLs of different .Net platforms. Platform as we understand means full .NetFramework, .NET Core, Xamarin, Silverlight, XBox etc.
.NET Core is an implementation of the .NET Standard that is optimized for building console applications, Web apps and cloud services using ASP.NET Core. Its SDK (Software Development Kit) comes with a powerful tooling that in addition to Visual Studio development supports a full command line-based development workflow.
How Aspire can help?
Our programmers are certified and are expert in dot net development. Please reach out to us for any of your requirements, and we will design the entire .NET Standard or .NET core framework as per your requirement and integrate all your existing tools and applications into it.
We at Aspire software Consultancy (ASC), provide Microsoft .NET development services that are one of the best in the industry. We are an ISO certified company and a NASSCOM member and have been serving more than 300 clients in the US and India, since our inception 13 years ago.