MSBuild 使用 Take 无法加载程序集

发布于 2025-01-03 10:26:22 字数 853 浏览 4 评论 0原文

我正在尝试使用 MSBuild 和 YUICompressor for .NET 在构建时压缩我的 js 和 css 文件。

我正在关注此处 和 此处

当我尝试构建时,出现以下错误:

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.

请确认声明是否正确,程序集及其所有内容 依赖项可用,并且该任务包含一个实现 Microsoft.Build.Framework.ITask。

我的构建后命令是这样的:

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

关于为什么会发生这种情况有什么想法吗?程序集似乎位于正确的目录中。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凌乱心跳 2025-01-10 10:26:22

解决了这个问题...我需要在UsingTask设置中引用不同的dll

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

请参阅http的下载部分引用的示例应用程序://yuicompressor.codeplex.com/

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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文