简体   繁体   中英

How do I update C# using developer command prompt?

We are not allowed to use Visual Studio in our school, we have to write them in Notepad++ and then compile them using Developer Command Prompt for VS 2022 using csc .

I get a bunch of problems in my personal computer than I don't get in my school computer because of my outdated C# version. How do I update it using, preferably, the Developer Command Prompt?

The C# language feature you're trying to use is called Top Level Statements , which was introduced with C# 9.

In order to compile for C# 9 you'll need to install the latest .net SDK.

You'll probably want to install the .net 5.0 64-bit SDK from this page . (It does say that "Visual Studio 2019" is required on the download page, but it doesn't mean that you need to have Visual Studio installed - your command-line builds will work fine.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM