I am trying to use the microsoft reference source but ran into problems. As per their suggestion for troubleshooting I tried to validate that I am using the right .NET framework version. ildasm however shows this:
I did however change the target framework of the project as you can see here:
Do I need to change the version somewhere else?
What you got is accurate. A project that targets .NET 4.5 or 4.5.1 still uses CLR version 4.0.30319 and core framework assemblies like mscorlib v4.0.0.0
This is largely a repeat with what happened for .NET versions 3.0, 3.5 and 3.5SP1, they target CLR version 2.0.50727 and core framework assemblies v2.0.0.0. Just like 4.5 and 4.5.1, they were not new side-by-side versions. They just added new assemblies to the existing set.
You can still tell what target you have selected with ildasm.exe, look at the System.Runtime.Versioning.TargetFrameworkAttribute attribute you see in the metadata. The CLR checks this to ensure you are not trying to run a 4.5.1 on a .NET 4.0 or 4.5 install. Offering to download the version you need. It looks like this (edited for readability):
.custom instance void [mscorlib]System.Runtime.Versioning.TargetFrameworkAttribute::.ctor(string) =
( 01 00 1C 2E 4E 45 54 46 72 61 6D 65 77 6F 72 6B // ....NETFramework
2C 56 65 72 73 69 6F 6E 3D 76 34 2E 35 2E 31 01 // ,Version=v4.5.1.
00 54 0E 14 46 72 61 6D 65 77 6F 72 6B 44 69 73 // .T..FrameworkDis
70 6C 61 79 4E 61 6D 65 14 2E 4E 45 54 20 46 72 // playName..NET Fr
61 6D 65 77 6F 72 6B 20 34 2E 35 2E 31 ) // amework 4.5.1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With