In Windows systems, use the command csc <filname>.cs
in the command prompt while the current directory is in Microsoft Visual Studio\<Year>\<Version>
There are two ways:
Using the command prompt:
Using Developer Command Prompt :
Start --> Developer Command Prompt for VS 2017 (Here the directory is already set to Visual Studio folder)
Use the command: csc /.cs
Hope it helps!