The CLR (Common Language Runtime) version is 4.0.30319.18034. It starts with 4.0.30319 because .NET 4.5 is an in-place upgrade of the .NET 4.0 assemblies.
The 4.5 update completely replaces the .NET 4.0 runtime and leaves the actual version number set at v4.0.30319.
(source 1, source 2)
But your version number probably represents .NET 4.5 with some updates, as might be deduced from this list by user Daniel:
Here are some examples of runtime versions I've seen:
- 4.0.30319.1 = .NET 4.0 RTM
- 4.0.30319.269 = most common .NET 4.0 version we're seeing in the data collected from our users
- 4.0.30319.544 = another .NET 4.0 version that a small portion of our users have installed
- 4.0.30319.17626 = .NET 4.5 RC
- 4.0.30319.17929 = .NET 4.5 RTM
- 4.0.30319.18010 = current version on my Windows 8 machine
The major, minor and build version numbers didn't change, so I reckon they didn't think the difference between .NET 4.0 and 4.5 would be big enough to matter for most people. Applications for .NET 4.0 that expect some version 4.0.30319 still work as expected under .NET 4.5.
Whether you code for .NET 4.0 or 4.5, you are compiling against the exact same .NET assemblies. The only difference is that some new classes from .NET 4.5 are hidden when compiling against .NET 4.0 (as if they never existed). So the only reliable way to tell the difference between .NET 4.0 and 4.5 seems to be the rather hackish approach proposed by Christian.K in his post, that doesn't involve version numbers:
The ReflectionContext
class seems to be totally new with the .NET framework 4.5 and conveniently lives in mscorlib
. So you could do something like this.
public static bool IsNet45OrNewer()
{
// Class "ReflectionContext" exists from .NET 4.5 onwards.
return Type.GetType("System.Reflection.ReflectionContext", false) != null;
}