After installing VS 2015, running csc.exe from command line causes this message to be displayed to console:
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 versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
The link redirects to Roslyn's repository at GitHub.
So, is the a way to run "compilers that support newer versions" (Roslyn) from command line?
To run C# Code in cmdset path of cmd by using (set path="") command. Now go to the folder (by using cmd) in which you save your c# file which you create in step 2. Now enter csc "your file name."cs in cmd. Now if you set correct path and your coding is correct then a .exe file is created run that file on cmd.
You can invoke the C# compiler by typing the name of its executable file (csc.exe) at a command prompt. For . NET Framework projects, you can also run csc.exe from the command line. Every compiler option is available in two forms: -option and /option.
It sounds like your path is inappropriate, basically. If you open the "Developer Command Prompt for VS2015" you should have $ProgramFiles(x86)$\MSBuild\14.0\bin
early in your path - and the csc.exe
in there is Roslyn.
I suspect you're running the version in c:\Windows\Microsoft.NET\Framework\4.0.30319
or similar - which is the legacy one, basically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With