Reputation: 421
I've found a partial answer to my question in this thread:
Here on stackoverflow cannot change target framework...
In my case, the framework has successfully been converted to 4.5.2, and putting a method with async and await, that I'm sure are part of framework 4.5, the method is successfully run by an exe referencing the library. So I can presume that the library is really compiled using framework 4.5.2.
However, when referenced in any other project the library shows in its properties that it is compiled under framework 4.0. and when the debugger loads the assembly it prints out that it is compiled under framework 4.0... So who is right? my code executing methods of framework 4.5 or the strings telling the library is on framework 4.0?
I've checked for what possible in my abilities if there are any .targets files in my installation, and yes there are two, under the msbuild-targets temporary folder, Microsoft.Common.targets and Microsoft.Csharp.targets, but I'm not able to understand if these files force the compiler to use framework 4.0. Mainly because on this machine I compile directly in visual studio.
I have several solutions using component libraries compiled 4.5.2 that work correctly. So I don't really know how to be sure that my library is compiled under the right framework and that the library shows the right framework in its properties and when loaded.
If anyone has a clue on how to achieve this, thank you in advance.
Upvotes: 2
Views: 171
Reputation: 64943
If your project properties say you're targeting .NET 4.5.2, then it's being built to work with .NET 4.5.2 and above versions.
Maybe you've a confusion with CLR and Framework versions. .NET 4.x (any) work with CLR (i.e. Common Language Runtime) 4.0.
Check .NET Framework Versions and Dependencies to get further details about this topic.
Upvotes: 4