我正在尝试在 MSbuild ( http://yuicompressor.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=22364 ) 中使用 YIUCompression DLL,但是当我运行 MSBuild 时,我不断收到以下错误:
输出:
目标构建:
开始 Css/Javascript 压缩...# Found one or more JavaScript file arguments. Now parsing ... ** Obfuscate Javascript: Yep! ** Preserve semi colons: Yep! ** Disable optimizations: Hell No! ** Line break position: None ** Thread Culture: Not defined # 1 JavaScript file requested. => C:\JSMinify\YIUCompressor\Test\disableButton.js C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Failed to read in the data for the path/file [C:\JSMinify\YIUCompressor\Test\disableButton.js]. The most common cause for this is because the path is incorrect or the file name is incorrect ... so please check your path and file names. Until you fix this up, I can't continue ... sowwy. C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Value cannot be null. C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): error : Parameter name: value Finished compressing all 1 file. Total original JavaScript file size: 405. After compression: 0. Compressed down to 0% of original size. Compressed content saved to file [C:\JSMinify\YIUCompressor\Test\disableButton.js].
Finished Css/Javascript compression.
Total time to execute task: 00:00:00.0312510
在项目“Millena-I.Build.proj”中完成构建目标“Build”。
完成建设项目“Millena-I.Build.proj”。
构建成功。C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): 错误:无法读取路径/文件 [C:\JSMinify\YIUCompressor\Test\disableButton.js] 的数据。最常见的原因是路径不正确或文件名不正确...所以请检查您的路径和文件名。在您解决此问题之前,我无法继续... sowwy.C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5): 错误:值不能为空。C:\JSMinify\YIUCompressor\Millena-I.Build.proj(17,5):错误:参数名称:值
以下是我的构建脚本:
<!-- Execute CompressorTask for each file in the list -->
<CompressorTask
Condition="'%(JavaScriptFiles.Identity)' != ''"
JavaScriptFiles="%(JavaScriptFiles.Identity)"
ObfuscateJavaScript="FoSho"
PreserveAllSemicolons="Yeah"
DisableOptimizations="Nope"
EncodingType="Default"
DeleteJavaScriptFiles="true"
JavaScriptOutputFile="%(JavaScriptFiles.Identity)"
LoggingType="ALittleBit" />
我已授予文件夹和文件的全部权限(已删除只读)。令人惊讶的是,当构建失败时,我的文件完全空白!