What is .NET?
Stephen Hustedde
Faculty- CIS (Software Development); past Interim Dean of Academic Innovation; and past mCLCTL Division Chair (myCareer, Library and Center for Teaching and Learning) at South Mountain Community College
What is .NET?
By Stephen Hustedde (South Mountain Community College faculty) – October 2022
? 2022, Stephen Hustedde
Student Question:
When I create a new Windows Form application in Visual Studio 2022, I am prompted to choose a framework of .NET Core 3.1, .NET 5.0, or .NET 6.0. What is .NET? What are the differences in these three and which should I choose?
Instructor Response:
What is .NET?
.NET (pronounced dot NET) is a framework. I like to think of .NET as the ecosystem in which we create C# applications for various platforms. As an analogy of woodworking, the workbench represents Visual Studio where one crafts his or her project, but the workshop with all its tools, equipment and materials would be the .NET framework/ecosystem.
Frameworks contain pre-built functionality that makes it easy for us as developers to create applications that run on a specific platform (in this case, Windows). The Class Library of .NET includes thousands of thoroughly tested classes, organized into libraries called APIs (Application Programming Interfaces). When we add a button to a WinForm project, we are utilizing the prebuilt Button class which manages the properties of our button and provides recognition of events such as a Click, enabling us to code what should happen when the user clicks the button. When we add the ability of a project to read or write data to text file, we include a directive in our code of “using System.IOâ€. This directive makes the Input/Output API available in our project so we can utilize a StreamReader and/or StreamWriter object and all their associated methods. In essence the framework permits us to build our project with various building blocks.
The .NET framework also contains the Common Language Runtime (CLR). This is a Virtual machine (VM) that manages our code and allows it to interact with the operating system. It is integral in compiling our C# source code into the executable machine language code for it function properly with Windows.
The idea behind Microsoft’s .NET (released in 2000), is that developers could code in various programming languages, such as VB.NET, and later C# (2002) and F# (2005), with the operating system functionality handled seamlessly by .NET. And as the .NET framework was expanded for other platforms, developers could use these languages and tools (such as the Visual Studio IDE [Integrated Development Environment]) to create cross-platform applications. Like all other software, each new release of the .NET framework was given a progressive version number. Generally, the timing coincided with each new release of Visual Studio (and supported new releases of Windows or Windows Server), though some minor updates were made along the way.
So what about .NET Core 3.1, .NET 5.0, or .NET 6.0?
In 2016, Microsoft introduced the .NET Core framework, aimed at providing cross-platform development support for the MacOS and Linux. Originally, .NET Core was aimed at ASP.NET Core (ASP = Active Server Pages and refers to dynamic web page processing), Blazor (later), Internet of things, Cloud development with Azure and Universal Windows Platform (UWP) apps. UWP includes the suite of Windows platforms (desktop, Windows mobile, Xbox, Internet of Things, etc.)
Desktop projects of WinForms and Windows Presentation Foundation remained solely under the standard .NET framework. But in 2019, the release of .NET Core 3.0 added WinForm and UWP project support (thus the choice we have today). It seemed destined that .NET Core would soon replace the .NET Framework.
And it did in 2020. But the new unified version was not .NET Core 4.0. It was re-branded as .NET 5. And in 2021, it gave way to .NET 6 as the latest version. ?Microsoft intends to release .NET 7 in November 2022 and then .NET 8 in November 2023. Microsoft has announced their intent to release a new version each November, with the even years being “current†releases that are supported for only 18 months and replaced with the “long term support†(LTS) releases in November of the odd years. LTS versions are supported for three years. This explains the “Long term support†and the “Out of support†designations in the framework choice of Visual Studio 2022 (topmost image).
There is one other framework worth mentioning here. The Mono framework was developed by Ximian in 2004. It was initially aimed at providing Visual Basic support for Linux. ?Long story short, it evolved into Xamarin (2011) and eventually provided shared functional code in C# and shared XAML interface scripting for creating Android and iOS mobile apps (Xamarin Forms) and a plug-in for Visual Studio project support. Microsoft purchased the Xamarin company and their products in 2016 and incorporated Xamarin projects directly in Visual Studio and Visual Studio for Mac. The Mono framework has been further developed and re-branded as .NET MAUI (Multi-platform App UI) in Visual Studio 2022 and incorporated into the .NET 6 framework.
This simplified table shows the history:
And this is where we find ourselves today with .NET MAUI (Multi-platform App User Interface). The .NET MAUI framework (housed within the .NET 6.0 framework) in Visual Studio 2022 affords us the ability to create programs for Windows, Android, iOS devices and MacOS through shared C# code, with shared interface code written in XAML markup language (similar to HTML used in website UI creation). .NET MAUI is a re-purposing and expansion of the previous Xamarin project line and the Mono framework.
Here’s my take on a visual representation:
Which framework should I choose for a Windows Forms (WinForm) project?
Currently, either .NET Core or .NET Framework 6.0. will work for our CIS162AD (C# Level I) and CIS262AD (C# Level II) courses at South Mountain. Avoid .NET 5 since it is outdated and unsupported. But given that the three-year support life for .NET Core 3.1 will end in a couple months (December 13, 2022) and was rolled into .NET 5, and the more-current .NET 6, I would strongly suggest choosing .NET 6 as your underlying framework.
Learn more about software development with C#
Want to learn more about creating Windows desktop applications using WinForms or cross-platforms mobile apps using C# and the Xamarin/.NET MAUI frameworks? Check out the video playlist for my CIS162AD | CIS165DC | CIS262AD cohort at https://bit.ly/2ZTtZ0i.