I was surprised when the source to the CoreCLR was published on GitHub a few weeks ago. Over the weekend I thought I’d start to build it and begin looking through the code in detail. I was amazed at how easy it is to build.
First you check out the sources from GitHub. Next you down the latest version of CMake and put it on your path. Then you run the build.cmd script. Your PC gets a bit busy for 30 minutes and then you have your own version of the CLR and the associated mscorlib.dll. [There is one gotcha concerning the DIA SDK that the script will warn you about – the fix is a copy from an older VS installation to the newest]
You can then use your existing C# compiler to compile against this version of the CLR.
c:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /nostdlib /r:D:\git\coreclr\binaries\Product\x64\debug\mscorlib.dll test.cs
and then run it using CoreRun