I manually invoke the C# compiler using the command line in order to compile a C# source file. However, the compilation sticks to C# 5. I access it using the path to VS2017, so I expected it to work on higher versions of C# as well. Setting the /langversion
property does not seem to do the trick.
Any help?
PS C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Roslyn> csc
Microsoft (R) Visual C# Compiler version 4.7.2558.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 versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
warning CS2008: No source files specified error CS1562: Outputs without source must have the /out option specified
.. but only supports language versions up to C# 5