A framework is a collection of Application Programming Interfaces (APIs) and a shared library of code that developers can call when developing applications, so that they don't have to write the code from scratch. The purpose is to allow developers to dedicate their efforts to the application's specific requirements rather than having to reinvent the wheel every time their applications need to perform some common function. Instead, they can focus on the code that is unique to their applications and the user interface that ties it all together.
For example, let's say your application needs to be able to ping another IP address on the network. Instead of writing that piece of code yourself, you can use code from the shared library that performs that same function.
Using a framework also helps provide standards between applications. Other developers can make sense of what a program is doing more easily and users of the applications can count on things like Open and Save As dialog boxes working the same in different applications.
Frameworks take the form of libraries, where a well-defined API is reusable, but it's important to acknowledge that a framework is different from a library.
Now that we understand what a framework is, what is the .NET framework then?
.NET is a software development framework and an accompanying ecosystem of tools, languages, and runtimes that is designed and developed by Microsoft to ease application development across various platforms, from desktops to mobile devices. In a nutshell, it is a virtual machine for compiling and executing programs written in different languages such as C#, VB.NET, etc.
Microsoft started working on the .NET framework in the late 90s. The idea was to create a platform based on so-called managed code - code that can be executed under a runtime environment. This was needed to improve development experience and relieve engineers from handling security operations, active memory management, and other low-level efforts that C/C++ developers had to bother with.
The first release of .NET framework in 2002 introduced C#, a language for writing managed code that had a design similar to C++. The framework itself aimed at Windows-based computers and servers. It had:
- WinForms: a GUI library for desktop applications
- ASP.NET: a framework for Web
- ADO.NET: used for data access
Since that time, the framework has undergone multiple iterations spanning runtime updates, new desktop graphical systems (WPF), APIs for service-oriented applications (WCF), and more.
In 2014, Microsoft announced a dramatic shift in the way .NET exists by presenting .NET Core, a new cross-platform, cloud-friendly, and open-source version of the framework.
In 2016, Microsoft acquired Xamarin, previously a proprietary technology for cross-platform mobile development, making it open source as well.
In May 2019, Microsoft announced the big release that unified the whole ecosystem. All .NET products was bundled in the .NET 5 development platform allowing developers to build applications on Windows, Linux, macOS, iOS, watchOS, Android, tvOS, or using Web Assembly with just a single .NET.