Getting Started With .NET 5.0

Introduction 

 
This article explains how we can install .NET 5.0 and create a new Web Application with it.
 
Most of us know that .NET 5.0 is scheduled to release in Nov 2020. But we can try .NET 5 preview version before the official production release of .NET 5.0.
 
Before proceeding to install .NET 5.0, Let us have a look at the .NET Core versions available to have a better understanding of versioning. We can visit the link https://dotnet.microsoft.com/download/dotnet-core to check details about all the .NET Core Versions.
 
 .NET 5.0
 
As we can see that .NET 5.0 is the next major version of .NET Core after 3.1.x. Let us have a look at how we can install and use it.
 
Step 1 - Download Visual Studio 2019 V16.6 Preview 1
 
Before Installing .NET 5.0, please make sure that we are having Visual Studio 2019 V16.6 or upper version. Right now, at the time of writing this article, the latest official version of Visual Studio 2019 is V16.5. It means right now we cannot use .NET 5.0 with this version, but we can go with the preview version of Visual Studio which can be downloaded from the below link.
 
 .NET 5.0
 
We can choose any edition. Right now, I am showing the demo with Community Edition because it is already installed in my machine.
 
Step 2 - Install .NET 5 Preview SDK
 
After Installing the Preview version of Visual Studio 2019 V16.6, We need to download and install .NET 5.0 Preview 1 SDK, and it can be downloaded from the following link.
 
We can choose the appropriate SDK as per our operating system. Right Now, I am using it with Windows 10 64 bit. So, I have downloaded from the “Windows x64” link, as shown in the below screenshot. We have multiple download links, and we can choose based on our requirements.
 
 .NET 5.0
 
Once it is downloaded, execute the installable file and follow the on-screen instructions to install it.
 
Step 3 - Create a .NET 5.0 Application with Visual Studio 2019
  • Open Visual Studio 2019 Preview
  • Click on “Create a new project”.
  • Choose “ASP.NET Core Web Application”
 .NET 5.0 
  • Configure your new project

    • Project Name: “FirstDotNet5App”
    • Click on the “Create” button.
 .NET 5.0 
  • Choose .NET Core Version from Drop Down list
 .NET 5.0
  • Settings for our .NET 5 Web Application

    • Framework: “.NET Core”
    • Framework Version “ASP.NET Core 5.0”
    • Application type: “Web Application”.
    • “Configure for HTTPS”: Uncheck it for right now
    • Enable Razor runtime compilation: Leave it unchecked
Then click on the “Create” button to create the project.
 .NET 5.0 
 
The following is the screenshot of Visual Studio for a newly created Application:
 
 .NET 5.0
 
Step 4 - Running the Application
 
Until now, we have seen that the project has been created successfully targeting .NET Core 5.0. Let's run the application to see the output.
 
 .NET 5.0
 

Conclusion 

 
Finally, we have created our first .NET 5.0 application. With .NET 5.0 preview 1, there are no major changes, and everything is almost similar to the .NET Core 3.1.x. But in future releases of .NET 5 significant changes are expected.


Similar Articles