Getting Started With .NET 6

Introduction

 
Hello everyone. As we all know, Microsoft has recently launched a .NET 6 preview and confirmed it on their official blog site. With the new version of .NET after the .NET 5 release, there have been significant improvements that Microsoft is doing for this .NET 6 stable release for LTS (Long Time Support). In this article, we will see how to set up the .NET 6 (Preview) in Visual Studio.
 
Installations
  • .NET 6 SDK - You can download the SDK for Visual Studio and it will only support the Visual Studio 2019 version(16.9) preview edition.
  • Visual Studio 2019 (16.9) Preview - Make sure to install this edition for Windows, Mac, and Linux whichever platform your operating system is comfortable with.
NET 6 has been tested with Visual Studio 16.9 Preview 4 and Visual Studio for Mac 8.9. Please try to use those builds if you want to try .NET 6. 
 
Support
 
.Net 6 officially going to be released in November 2021 and it will be supported for 3 years Long time support (LTS). The matrix in this .Net 6 is improved more when compared to .Net 5.
 
The additions are:
  • Android.
  • iOS.
  • Mac and Mac Catalyst, for x64 and Apple Silicon “M1”.
  • Windows Arm64 (specifically Windows Desktop). 

Creating a project under .Net 6 

 
After installation of .Net 6 SDK and vs 2019 preview, I will create a sample API project to show the process.
 
Open the Visual Studio and choose the template and click on create button.
 
 
Add the project name and click on the Next button 
 
 
Choose the Target framework as .Net 6 (Preview) and click on the Create button. 
 
 
Double click on the Project. We can see the target framework shown as .NET 6 in our solution, which I shared below: 
  1. <Project Sdk="Microsoft.NET.Sdk.Web">  
  2.   
  3.   <PropertyGroup>  
  4.     <TargetFramework>net6.0</TargetFramework>  
  5.   </PropertyGroup>  
  6.   
  7.   <ItemGroup>  
  8.     <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />  
  9.   </ItemGroup>  
  10.   
  11. </Project>  
Run the project:
 
 
Here is a clear picture of how to setup .NET 6 and create a sample API project.
 
I hope this helps you understand .NET 6 in a step-by-step process. If you found this article helps you, give it a !
 
Keep learning......!