To execute a C# file, you first have to compile it. The compiler's name is
csc
and can be found in
%windir%\Microsoft.NET\Framework\v<version>
. For example, the compiler for .NET 4.0 is in
v4.0.30319
.
To compile a C# file from the command line, do this:
%windir%\Microsoft.NET\Framework\v<version>\csc file.cs /out:application.exe
More information:
https://msdn.microsoft.com/en-us/library/78f4aasd.aspx[
^]
After compiling it, you can execute the .exe file.