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.
Adding the Microsoft.Net.Compilers package to the project solved this issue for us.
ReplyDeleteThis package is included in the ASP.NET Empty Web Site template for sites targeting 4.5.x, but is not added automatically to sites when the target framework is changed to 4.5.x from a previous version.
I've tried adding the Microsoft.Net.Compilers package but it doesn't help. My site targets 4.5.2 and builds locally, but using MSBuild 14 on a different server fails with this error message.
ReplyDeleteOh, the fun, I want to stress the fact you need to pay attention to copy all the dlls about the build complains. I forgot one and I thought this wasn't the solution.
ReplyDeleteJust spent some painful 4 hours on this... Jeez...
ReplyDelete