Language: EN

como-empezar-en-net-6-con-un-sencillo-tutorial-hola-mundo

Getting started in .NET 6 with a simple "Hello world" tutorial

The .NET application platform is Microsoft’s bet for developing desktop applications, web services, and mobile applications, being one of the most widely used development technologies at the moment.

Launched on November 8, 2021, .NET 6 is the new LTS (long time support) version, which comes to replace .NET 3 Core and to finish the work started with .NET 5, especially in terms of unification.

This is precisely one of the strong points of .NET 6, achieving convergence between .NET technologies and the unification between architectures and operating systems.

This means that .NET 6 can natively run on different architectures and operating systems. Thus, .NET 6 is natively compatible with Windows, Linux, Android, and macOS (among others), and x86, x64, ARM32, and ARM64 processors.

Other improvements include performance enhancements, compatibility with C# 10, improvements for simplifying development, and improvements for productivity in development. In addition to MAUI, which will allow us to create graphical applications with a unified UI.

The next LTS version of .NET will be version 8, whose date is not expected until November 2023. So, for a while, .NET 6 will be the “preferred” version for Microsoft technology development.

In this post, we will introduce the use of .NET 6 with a simple example, a “Hello World” application, executed under Windows system.

In future posts, we will delve into the topic, especially in the use of Linux and Raspberry Pi, which is one of the most interesting aspects of .NET 6.

Installing .NET 6 SDK

Logically, we will need to have .NET 6 installed. This comes hand in hand with the “dotnet” executable, a CLI application that allows us to create and manage projects.

In the case of Windows, by installing Visual Studio Community, we will have everything installed, so it generally will not be necessary to install anything else.

However, we can always install .NET by downloading the appropriate version from the official website. https://dotnet.microsoft.com/en-us/download/dotnet

Check that we have dotnet installed

First of all, it is advisable to make sure that you have everything installed correctly. This is as simple as doing,

dotnet --version

If we have everything correctly installed

dotnet6-version

Create a new application with Dotnet

To create a console application we use the command

dotnet new <template>

Where