How do I update a compiler?

Viewed 175

So, I just installed net5 on this pc. It is fresh new and when I went to PowerShell and run the csc -langversion:? command to check which versions of C# it supports I receive this message:

Microsoft (R) Visual C# Compiler version 4.6.1038.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.

This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer v
ersions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240

warning CS2008: Nenhum arquivo de origem especificado
error CS1617: Opção '?' inválida para /langversion; deve ser ISO-1, ISO-2, 3, 4, 5 ou Default

Not only the compiler doesn't support C# 9.0 and it doesn't show the supposed message it was supposed to which is something like this:

default
1
2
3
4
5
6
7.0
7.1
7.2
7.3
8.0
9.0 (default)
latestmajor
preview
latest

As my nick suggests I'm pretty new to programming and stuff, so can anyone help me?

1 Answers

You say you installed .NET 5. But then you used the csc command which is not part of .NET 5. The output of the command even says that you are using .NET Framework, which is not .NET 5.

.NET 5 is a different thing than .NET Framework.

All .NET 5 command are invoked using dotnet.

dotnet --info will tell you if the .NET 5.0 SDK is installed. If you have the .NET 5 SDK, it will support C#, even if you can't directly query the language version.

Related