When running MSBuild, you get this error:
The imported project Microsoft.WebApplication.targets was not found
I fixed the imported project Microsoft.WebApplication.targets was not found error by ensuring that the correct version of MSBuild was being called (in my case v4 was being used instead of v14 – Running “msbuild ?” in the command prompt reported the MSBuild version). Also I had to update to dotNET 4.7.1.