gpt4 book ai didi

asp.net - Yahoo.Yui.Compressor.Build.MsBuild.dll。无法加载文件或程序集“Yahoo.Yui.Compressor”

转载 作者:行者123 更新时间:2023-12-02 16:27:57 33 4
gpt4 key购买 nike

我正在使用Yahoo.Yui.Compressor.Build.MsBuild压缩 cssjavascript 文件。我已经安装了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. 

最佳答案

我刚刚遇到了同样的问题...

看来Yahoo.Yui.Compressor.dll需要与Yahoo.Yui.Compressor.Build.MsBuild.dll位于同一目录中。其他依赖项可能也是如此,例如 EcmaScript.NET.dll 和 Iesi.Collections.dll。

您可以将内容移至\lib\yui\目录,以便它们彼此并排放置,也可以引用 bin 文件夹中的程序集。

如果您决定引用 bin 文件夹中的程序集,则可能必须使用构建后事件(而不是预构建事件)来触发压缩。

关于asp.net - Yahoo.Yui.Compressor.Build.MsBuild.dll。无法加载文件或程序集“Yahoo.Yui.Compressor”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14894157/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com