Microsoft has released .NET 7 preview 1 last week Feb 17th, 2022. In this write-up, we will learn what’s new in .NET 7 preview and create a sample project in .NET 7. As per Microsoft, it is built on the foundation of .NET 6 that includes a unified set of base libraries, runtime, and SDK, an effortless development experience, and high-pitched developer productivity. Mainly, .NET 7 has brought enhanced support for cloud-native scenarios, tools to make it easier to upgrade legacy projects, and simplifying the developer experience by making it easier to work with containers. To know more about .NET 7 Preview 1 and its features, you can check the official announcement.

Prerequisites
    .NET 7 Preview
    Visual Studio 2022 17.2 Preview1

You can download and install .NET 7 preview from here. Additionally, you need to download and install Visual Studio 2022 17.2 Preview1 (VS2022 17.2 Preview 1) from Official Microsoft here.

If you have already installed the visual studio 2022 17.1.0 version then, installing the above two prerequisites will be enough for you. You can directly configure from Visual Studio 2022 17.1.0 to Visual Studio 2022 17.2 Preview1 by changing the update setting. For this, you can follow the article Enable Preview version in Visual Studio 2022.

Now, Let’s create a console application in .NET 7.

Step 1
Open Visual Studio 2022 and click Create a new project.

Step 2
Select Console App as shown below and click Next.

Step 3
Give the project name, location of the project, and click on Next.

Step 4
Then, select Framework: .NET 7.0(Preview) as illustrated below and click Create.

Then it will create a project which looks like it as depicted below. You can see, there are no differences in Program.cs file of .NET 6.0 and .NET 7.0 preview. You can refer to the previous article on Getting Started with .NET6 to learn .NET 6.0.


Project.csproj file looks like below.

If you go to the bin folder-->debug, then you will see .net7.0 folder. Inside this folder files including dll, exe, and all relevant files to your project will be available there.


You can run the .exe and launch your application. When you launch the app, it will display the “Hello, World!” message.

Hence, we have created a console application in .NET 7.0.

Summary
In this article, we learned what is needed to get started with .NET 7.0 preview and its features. Additionally, we created the console application in .NET 7. Microsoft has released .NET 7 preview 1 recently which is based on the foundation set up by .NET 6. It is available in Visual Studio 2022 version 17.2 Preview 1 with improvement in Web Tools, Git Tooling, Productivity, Razor (ASP.NET Core) Editor, debugging and Diagnostics, and so on.

HostForLIFE.eu ASP.NET Core Hosting

European best, cheap and reliable ASP.NET hosting with instant activation. HostForLIFE.eu is #1 Recommended Windows and ASP.NET hosting in European Continent. With 99.99% Uptime Guaranteed of Relibility, Stability and Performace. HostForLIFE.eu security team is constantly monitoring the entire network for unusual behaviour. We deliver hosting solution including Shared hosting, Cloud hosting, Reseller hosting, Dedicated Servers, and IT as Service for companies of all size.