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

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

  • 4 min

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.

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

Precisely, this is one of the strong points of .NET 6, achieving convergence between .NET technologies and unification across architectures and operating systems.

This means .NET 6 can run natively 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, support for C# version 10, improvements for simplifying development, and productivity improvements 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 development with Microsoft technology.

In this post, we are going to introduce the use of .NET 6 with a simple example, a “Hello World” application, run on a Windows system.

In future posts, we will delve deeper 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 with the “dotnet” executable, a CLI application that allows us to create and manage projects.

In the case of Windows, installing Visual Studio Community will have everything installed, so generally we won’t need 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, it’s a good idea to make sure 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