The fastest way to check your .NET version

Open a command prompt or terminal and run dotnet --version. This command returns the version of the .NET SDK or runtime installed on your computer. If you have multiple versions installed, this shows the default one your system uses.

On Windows, press the Windows key, type "cmd", and press Enter. On Mac or Linux, open Terminal. Type dotnet --version and press Enter. The output appears immediately below your command.

If you see an error saying the command is not recognized, .NET is either not installed or not added to your system path. You can still check what versions exist on your machine using the methods described in the sections below.

Key Takeaways

  • The command dotnet --version shows your default .NET version in any command prompt or terminal.
  • Use dotnet --list-sdks and dotnet --list-runtimes to see every version installed on your computer.
  • On Windows, you can also check installed versions through Programs and Features in Control Panel.
  • Different projects may require different .NET versions, so knowing what you have installed helps you understand compatibility.

Viewing all installed .NET versions at once

If you have installed multiple versions of .NET, dotnet --list-sdks shows every SDK version on your machine. Run this command in your terminal or command prompt to see the full list with file paths.

dotnet --list-runtimes shows every runtime version installed separately. The SDK includes the runtime, but you may have additional runtimes installed for running applications. Both commands work on Windows, Mac, and Linux.

The output shows version numbers like "8.0.0", "7.0.5", or "6.0.11" along with the folder where each version is stored. This is useful when you need to know whether a specific version your project requires is actually on your computer.

Checking the version in Windows Control Panel

On Windows, you can see installed .NET versions without opening a terminal. Go to Control Panel, select Programs, then Programs and Features. Scroll through the list and look for entries that start with "Microsoft .NET".

You will see entries like "Microsoft .NET Framework 4.8" or "Microsoft .NET 8.0.0". Each entry represents a version installed on your system. This method does not show you the default version your computer uses, but it confirms what is physically installed.

This approach is slower than using the command line, but it works if you are not comfortable opening a terminal or if you prefer a graphical interface.

Finding the version a specific project uses

If you have a project folder, the version it targets is usually stored in a file called the project file. For newer .NET projects, open the .csproj file (or .vbproj for Visual Basic) in any text editor and look for a line containing <TargetFramework>.

The value next to it shows the target version, such as net8.0 or net6.0. Older .NET Framework projects may have a packages.config file or a web.config file that lists version information instead.

You can also run dotnet --version from inside the project folder. Some projects use a global.json file to force a specific SDK version, which overrides your default and is shown when you run this command from that location.

Understanding SDK versus runtime versions

The SDK (Software Development Kit) is what you use to build and compile .NET applications. The runtime is what runs those applications after they are built. You need the SDK if you are writing code; you only need the runtime if you are running someone else's application.

dotnet --version shows your SDK version. If you have installed only the runtime, this command will not work. Runtimes are smaller downloads and are often installed on computers that only run .NET applications, not build them.

A single computer can have many SDK versions and many runtime versions installed at the same time. Your default SDK version (shown by dotnet --version) is usually the newest one, but you can override this with a global.json file in your project folder.

What to do if .NET is not found

If you run dotnet --version and see "command not found" or "is not recognized as an internal or external command", .NET is not installed or not in your system path. First, check whether .NET is actually installed by looking in Control Panel (Windows) or by searching your Applications folder (Mac).

If .NET is installed but the command does not work, the system path may not include the .NET installation folder. On Windows, restart your computer after installing .NET, as the path is often updated only after a restart. On Mac or Linux, you may need to add the .NET installation directory to your PATH manually.

If .NET is not installed at all, download it from the official .NET website. Choose the version you need based on your project requirements or the application you want to run. The installer will add .NET to your system path automatically.

Checking version in Visual Studio or VS Code

If you use Visual Studio, open your project and go to Project Properties. The Target Framework dropdown shows the .NET version your project targets. This is the same information stored in the .csproj file, but displayed in a graphical interface.

In Visual Studio Code, open the .csproj file directly and look for the <TargetFramework> line, or use the terminal built into VS Code to run dotnet --version. The terminal in VS Code works the same way as your system terminal.

Both editors also show you which SDK version is active in the status bar or in the output window when you build a project. This helps you confirm that the version you expect is actually being used to compile your code.

Frequently Asked Questions

Why do I have multiple .NET versions installed?

Different projects may require different .NET versions, and installing a new version does not remove old ones. You might have .NET 6, 7, and 8 all on the same computer. Each version can coexist without conflict, and your system uses the default version unless a project specifies otherwise.

Is .NET Framework the same as .NET?

.NET Framework is an older technology that only runs on Windows. Modern .NET (versions 5 and newer) runs on Windows, Mac, and Linux. They are separate products. dotnet --version shows modern .NET; .NET Framework versions appear separately in Control Panel.

Can I have .NET SDK without the runtime?

No. The SDK includes the runtime. If you install the SDK, you automatically have the runtime. You can install the runtime alone if you only need to run applications, but you cannot have the SDK without the runtime.

What does the version number mean?

Version numbers like "8.0.0" break down as major.minor.patch. A change in the major number (8 to 9) means significant new features. A minor change (8.0 to 8.1) adds smaller features. A patch change (8.0.0 to 8.0.1) fixes bugs. Projects usually target a major version like "net8.0" rather than an exact patch number.

How do I know which version I should install?

Check your project's documentation or the .csproj file to see which version it requires. If you are starting a new project, the latest version is usually the best choice. Older projects may require older versions, which is why having multiple versions installed is common.