Severity Code Description Project File Line Suppression State Error The "JavaScriptCompressorTask" task could not be loaded from the assembly Yahoo.Yui.Compressor.Build.MsBuild.dll. Could not load file or assembly 'Microsoft.Build.Utilities, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
The solution was to install .NET 3.5 framework on the machine. I was already having the .NET 4.8 framework on my machine.
After installing the .NET 3.5 Framework the problem was gone.
It seems Yahoo.Yui.Compressor needs 3.5 framework for its dlls.