My dependent projects were all re-compiled under framework 4.5 without any issue.
Visual Studio 2012 compiled the web site without any issue either.
While the build server, working under Jenkins had its MSBuild job failing with MSB3268 warnings saying that the System.Threading.Tasks and System.Runtime assemblies could not be found under the framework version of "v4.5".
A deeper inspection revealed the following interesting fact: aspnet_compiler for some reason does not take into account the .dll-s that reside under the Facade directory of 4.5 assemblies (C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades).
It looks only under
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
As a result the whole thing failed since both System.Threading.Tasks and System.Runtime .dll-s were under the Facades directory and not inside the v4.5.
Now the solutions:
- Just simply copy the missing .dll-s from Facade to the v4.5 directory.
- Set the TargetFrameworkMoniker to 4.5.1 in the .sln file. The exact syntax is as follows: TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5.1".
Very tiring.