I have a ASP.NET MVC5 Web Application configured to run on .NET Framework version 4.5.1. However, I notice that when I get an application runtime exception of some sort, the version information displayed at the bottom of the yellow server error page says the following:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009
Why is this not 4.5.x?
That is not the actual .NET framework version. It is the version of the CLR.
From .NET 4 up to 4.5.2 it is version 4. Between 2.0 and 3.5 it was version 2.0.
That is also the reason that in your application pool configuration you can only choose .NET 2 or 4.
See MSDN: .NET Framework Versions and Dependencies on this matter.