Microsoft's ambition to provide developers with one platform to solve any type of problem has been fulfilled by .NET. For a couple of decades already, the .NET platform has been powering up web, desktop, and mobile applications in both the startup and enterprise scenes.
Without any doubt, .NET plays a central role in the software development industry. .NET popularity in the developer community is a fact. You can measure it through the number of open source projects around the world and the presence of C# among the five most popular programming languages. Its popularity is going to grow even more, especially after the latest release (.NET 5), which revolutionizes the industry by pioneering the concept of universal software development.
To understand the power of .NET, let's explore some of its technical foundations.
What is .NET?
.NET is an open-source and cross-platform development platform for building many types of applications. Designed by Microsoft, the platform supports multiple programming languages and libraries to build web, mobile, desktop, IoT applications, and more.
Even if C# is considered the main programming language for .NET, you can use many other different languages of your choice. The languages directly supported by Microsoft are:
Visual Basic: The historical Microsoft programming language. It has become a full object-oriented programming language within the context of .NET.
.NET supports the Common Language Infrastructure (CLI), so your source code is compiled into a Common Intermediate Language (CIL), independently of the programming language you use. This guarantees great interoperability between languages in the platform.
Besides the above mentioned languages supported directly by Microsoft, many other programming languages can compile to the .NET CIL. For example, ClojureCLR, Eiffel, IronPython, PowerBuilder, and many others. For a complete list, check out this page.
.NET Architecture and Components
.NET allows you to build different application types, ranging from command-line to desktop applications, from web to mobile applications, from gaming to IoT applications.
This is possible thanks to its modular and optimized architecture.
The .NET architecture is based on two main components:
CoreCLR: This is the .NET runtime. It is responsible for executing CLI programs and includes a just-in-time compiler.
CoreFX: The platform’s API implementing the CLI Standard Libraries, that is, the set of libraries that provide the most common functionalities, such as file system management, exception handling, network communication, threading, reflection, and so on. The CoreFX component is sometimes called the Unified Base Class Library.
.NET Application Models
Above the core components, you have the different application model frameworks, that is, the libraries that offer support for developing different types of applications. So, for example, you have:
Xamarin: The framework for building cross-platform mobile, TV, and desktop applications.
ML.NET: The machine learning framework that simplifies the integration of machine learning models in your .NET application.
In addition to application model frameworks, .NET offers you support for most of the common programming tasks: from file management to network communication, from security to database access. For example, on the networking side, it supports socket programming, HTTP communication, and gRPC. This allows you to create microservices with the protocol that better fits your needs.
For any other needs not embedded in the framework, you can find a huge number of specific libraries on the public NuGet repository. In fact, NuGet is the package manager for .NET. It allows you to create, share, and use many .NET libraries for almost any purpose.
.NET Design and Development Support
.NET support for software development is not limited to the multiple programming languages you can use. .NET also promotes the use of some best practices while letting you use the approach you prefer to build your application.
For example, it encourages you to use dependency injection to decouple your application’s components. Dependency injection helps you design better software by limiting the component interdependence and facilitating reuse. In addition, it makes it easier to test your components.
By the way, on the testing side, .NET also comes with support for unit and integration tests via xUnit.
On the front of the development experience, developers can choose from different approaches. They can use the .NET CLI environment, using the command line to create new projects, adding dependencies, build, run, and so on.
They can use Visual Studio Code for an intermediate approach: an advanced cross-platform editor on top of the .NET CLI. Or they can use a powerful IDE like Visual Studio, available for both Windows and Mac, that provides you an interactive programming experience.
Regardless of the tool you choose, you can use many project templates to quickly start creating your new application. You can also create your own .NET project template.
From the .NET Framework to the .NET Platform
Microsoft launched the .NET project in 2002. Since the beginning, the .NET goal was to create a universal platform for programming with any language. Of course, as the first step, Windows was the main .NET target.
However, Microsoft submitted the specifications of the .NET runtime infrastructure and the C# programming language to ECMA for standardization. This led to the birth of a few porting projects on other platforms: Linux, embedded systems, mobile devices, browsers, and so on.
This also led to a fragmentation of the platform and sometimes generated confusion among developers. Take a look at this article to learn more about the evolution of .NET.
Let’s try to clarify the differences among a few common concepts.
The .NET Framework was the initial flavor of .NET. It provides the developer with a set of APIs for the most common programming needs and interacts with the underlying operating system. It runs only on Windows, and its lifecycle is coming to an the end right now, after the release of .NET 5.
The Mono project brings .NET to Linux machines. It is the best known porting project based on the .NET standard specifications. Even if Mono's aim is to run on Linux applications built for the .NET Framework and vice versa, the compatibility is not always guaranteed. There are a couple of reasons for this: some .NET Framework features are too tied to the Windows operating system, and often the Mono implementation lags behind the newest .NET Framework features.
.NET Core is a complete rewriting of the .NET Framework with the cross-platform goal in mind. Its redesigned architecture defines a minimal feature set as the common core across Windows, Linux, and Mac platforms. The rest of the features can be downloaded as library packages.
The .NET Standard is not another .NET implementation. It is a formal specification of .NET APIs that helps to create cross-platform libraries. If a platform supports a given .NET Standard version, then a library supporting the same version will run on it, regardless of the device type and the framework implementation (.NET Framework, Mono, .NET Core).
Since the beginning, the .NET term has been used to indicate the universal development platform. However, many implementations arose since then, so the .NET name created ambiguities. .NET 5 aims to make concrete the initial vision of a universal development platform. It replaces the current existing implementations: .NET Framework, .NET Core, and even Mono. So, from .NET 5 on, only .NET will exist as a name and as a platform.
Auth0 and .NET
Auth0 has extensive support for .NET that allows you to easily integrate modern authentication and authorization into your .NET applications: from specific SDKs to documentation, from blog posts to sample projects. In this section, you find a list of the .NET resources that Auth0 provides you.
Auth0 Quickstarts help you in setting up your first authentication and authorization integration. They guide you in adding the needed code and the required configuration step by step. If you are logged in, the code snippets are configured for your account. If you don't have an account, you can sign up for free with Auth0.
The following .NET-related Quickstarts are available:
- ASP.NET Core Web API v3.1: This Quickstart helps you to add authorization to an ASP.NET Core Web API using the standard JWT middleware.
- ASP.NET Core v3.1 Web Application: This Quickstart demonstrates how to add user login to an ASP.NET Core Web Application.
- WPF/Windows Forms (WinForms): The Quickstart guides you in adding user login Windows desktop C# applications.
- Xamarin: This Quickstart helps you add user login to Xamarin applications.
- Windows Universal App: Reading this Quickstart, you will learn how to add user login to Windows Universal C# applications.
Software Development Kits (SDKs)
Auth0 provides you the following SDKs to help you to integrate authentication and authorization in your .NET applications:
- .NET Client Library for Auth0: This SDK supports two APIs:
- Auth0 OIDC Client for .NET : This library supports OIDC authentication for .NET desktop applications based on WinForms, WPF, and UWP as well as Xamarin mobile applications.
.NET blog posts
In addition to SDKs and Quickstarts, Auth0 provides you with specific content, use cases, and code examples through its developer blog. You can find many .NET-related articles that help you build and secure your applications and keep up to date with the most recent features. Most articles include a sample project to demonstrate how to practically implement your apps. You can download them from GitHub, sign up with Auth0 if needed, configure the app, run it, and explore the code.
So, enjoy building your next .NET project with Auth0!