JIT version determining in runtime

1 · Andrey Akinshin · Feb. 28, 2015, midnight
Sometimes I want to know used JIT compiler version in my little C# experiments. It is clear that it is possible to determine the version in advance based on the environment. However, sometimes I want to know it in runtime to perform specific code for the current JIT compiler. More formally, I want to get the value from the following enum: public enum JitVersion { Mono, MsX86, MsX64, RyuJit } It is easy to detect Mono by existing of the Mono.Runtime class. Otherwise, we can assume that we wo...