Because both .Net 4.0 and .Net 4.5 use CLR 4 and .NET 4.5 is an in-place replacement for .NET 4.0, you can safely apply the next solution:
in the folder:
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework
there are set of folders, one for every installed framework.
The folder "v4.0" contain only xml files and folder "v4.5" contain both dll and xml files.
I created a symbolic link to this folder.
Run command prompt as an administrator.
Run the following script:
cd C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework
ren v4.0 v4.0_old
mklink /d v4.0 v4.5
A symbolic folder named "v4.0" is created and point to dlls of v4.5
Note:
This solution is not a hack for net4,because I introduced why this solution is safe, i provide excerpt from .NET 4.5 is an in-place replacement for .NET 4.0:
When .NET 4.5 is installed it effectively replaces .NET 4.0 on the machine. .NET 4.0 gets overwritten by a new version of .NET 4.5 which - according to Microsoft - is supposed to be 100% backwards compatible.
When you install .NET 4.5 your .NET 4.0 assemblies in the \Windows.NET Framework\V4.0.30319 are overwritten with a new set of assemblies. You end up with overwritten assemblies as well as a bunch of new ones.
If you open the properties of System.dll assembly in .NET 4.5 you'll also see: Notice that the file version is also left at 4.0.xxx.
This solution is like my own except it copies the assemblies from net45 to net4.
See also.NET Versioning and Multi-Targeting - .NET 4.5 is an in-place upgrade to .NET 4.0
Note: Net 4 life time is ended, it is better to upgrade to net 4.5.2