我正在使用Yahoo.Yui.Compressor.Build.MsBuild来压缩css
和javascript
文件。我已经安装了 Yahoo.Yui.Compressor.Build.MsBuild 2.2 并且 xml 文件的格式是
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/MsBuild/2003">
<UsingTask
TaskName="CompressorTask"
AssemblyFile="..\..\lib\yui\Yahoo.Yui.Compressor.Build.MsBuild.dll" />
<PropertyGroup>
<JavaScriptOutputFile Condition=" '$(JavaScriptOutputFile)'=='' ">..\scripts-min\myfile.min.js</JavaScriptOutputFile>
</PropertyGroup>
<Target Name="MyTaskTarget">
<ItemGroup>
<JavaScriptFiles Include="$(SourceLocation)..\scripts\myfile.js"/>
</ItemGroup>
<CompressorTask
CssFiles="@(CssFiles)"
DeleteCssFiles="false"
CssOutputFile="$(CssOutputFile)"
CssCompressionType="YuiStockCompression"
JavaScriptFiles="@(JavaScriptFiles)"
ObfuscateJavaScript="True"
PreserveAllSemicolons="False"
DisableOptimizations="Nope"
EncodingType="Default"
DeleteJavaScriptFiles="false"
LineBreakPosition="-1"
JavaScriptOutputFile="$(JavaScriptOutputFile)"
LoggingType="ALittleBit"
ThreadCulture="en-au"
/>
</Target>
</Project>
当我构建代码时,它显示以下错误
Error 18 The "CompressorTask" task could not be loaded from the assembly D:\Projects\YUI\..\..\lib\yui\Yahoo.Yui.Compressor.Build.MsBuild.dll. Could not load file or assembly 'Yahoo.Yui.Compressor, Version=2.2.0.0, Culture=neutral, PublicKeyToken=null'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.