0
votes

I am attempting to use MSBuild and the YUICompressor for .NET to compress my js and css files upon build.

I am following the documentation found here and here

When I try to build, I am getting the following error:

Error   4   The "CompressorTask" task could not be loaded from the assembly C:\Apps\MyApp\packages\YUICompressor.NET.1.7.0.0\lib\net35\Yahoo.Yui.Compressor.dll.

Confirm that the 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.

My post build command is as such:

$(MSBuildBinPath)\msbuild.exe /p:Configuration=$(ConfigurationName) "$(ProjectDir)MSBuild\MSBuildSettings.xml"

Any ideas on why this may be occuring? The assemblies seem to be in the correct directories.

1
I suppose..The project fails to build. I am attempting to create a post-build eventstephen776

1 Answers

0
votes

Solved this... I needed to reference a different dll in the UsingTask setting

 <UsingTask TaskName="CompressorTask" AssemblyFile="Yahoo.Yui.Compressor.MSBuildTask.dll" />

Please see the sample application referenced in the downloads section of http://yuicompressor.codeplex.com/