First go and download the beta 2 of the .NET framework 4 (current at the time of this writing).
Now, make sure C:WindowsMicrosoft.NETFrameworkv4.0.21006
is in your PATH environment variable.
Here s the MSDN page for the command-line compiler so you can see the options. For simple things it usually boils down to this:
// compile an executable
$ csc /out:App.exe *.cs
// compile a library
$ csc /target:library /out:Lib.dll *.cs
// compile with a reference to System.Core.dll
$ csc /out:App.exe /r:System.Core.dll *.cs
// compile with a reference to Microsoft.CSharp.dll (you might need this to use dynamic)
$ csc /out:App.exe /r:Microsoft.CSharp.dll *.cs
Of course try to use an editor with syntax highlighting. I believe C# 4 only introduces three new keywords, so you should be fine even with highlighting for version 3 (in
and out
already existed, but they are now valid in a new context and dynamic
is entirely new).