To get started developing applications with C# 10 and .NET 6, the .NET 6 SDK needs to be installed; this also installs the .NET 6 runtime.

To confirm the installation, open a command window and use the .NET command-line interface dotnet.exe. The --version option displays the highest version of the SDK installed on your machine, or the version specified in a global.json location at or above your current directory (dotnet --version).

Use dotnet --list-runtimes to show all of the .NET Core Runtimes installed on your machine. There is Microsoft.AspNetCore.App for building ASP.NET Core applications, Microsoft.NETCore.App which is the foundational runtime for .NET, and Microsoft.WindowsDesktop.App for building WinForms and WPF applications.

Use dotnet --list-sdks to show all of the SDKs installed.

New with .NET 6 is a command to check the installed versions and runtimes for updates (dotnet sdk check).

To pin your project to using an earlier version of the .NET SDK, you can use a global.json file.

For this book, you will want to install Visual Studio 2022 Community with the .NET desktop development, ASP.NET and web development, and Data storage and processing workloads. You should also select Class Designer and Git for Windows under "Code tools" on the "Individual components" tab before you click Install.

Visual Studio 2022 is a complete IDE for software development using .NET and C#. You can easily create a new console app through the "Create a new project" option and choosing the Console app template. Visual Studio also gives you the ability to design classes and other types (such as interfaces or delegates) in a visual manner.

{{c1::Visual Studio Code}} is a popular IDE by Microsoft (in addition to Visual Studio 2022) that is fast with limited functionality that can be customized through extensions.

To restore and build all the projects in your solution: dotnet build

To run your project without debugging: dotnet run

Article notes

What do you also get, that you might install separately, when you install the .NET SDK?
What is the command to list all the .NET runtimes installed on your machine?
What is the command to list all the .NET SDKs that are installed?
What's the first thing to install to get started developing applications with C# and .NET?
What long option to the dotnet command will display the .NET SDK version in use?
What long option to the dotnet command will display the installed runtimes?
What long option to the dotnet command will display the installed SDKs?
What in .NET terminology can contain multiple projects that all work together?
What is the dotnet CLI command to restore all of the NuGet packages required for your solution?
What is the dotnet runtime for building ASP.NET Core applications?
What is the dotnet runtime that is the foundational runtime for .NET?
What is the node in the *.csproj file that sets the .NET version?
What is the dotnet command to check for updates for your installed versions of the .NET SDK and runtimes?
What file can you put in a .NET project to make dotnet.exe --version in that directory (and any subdirectory) pinned to something?
[...] is a popular IDE by Microsoft (in addition to Visual Studio 2022) that is fast with limited functionality that can be customized through extensions.
Previous Next