You can have your own CLR too

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

D:\git\coreclr\binaries\Product\x64\debug\CoreRun.exe test.exe

Brilliantly painless.

This entry was posted in Computers and Internet. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s