我正在尝试将文档 XML 文件作为构建后 XSLT 转换进行后处理(使用新的 XSLTransformation 步骤),但构建失败并出现错误 无法执行转换。找不到文件“C:\...\documentation.XML”
。构建完成后,文档 XML 文件在磁盘上正常显示,但在 AfterBuild 步骤期间根本不存在:
未找到该文件,
也未找到该文件。
XslTransformation 步骤从名为 AfterBuild
的任务运行,并声明为依赖于 Compile
步骤。显然,我在声明此任务的方式中遗漏了一些内容,因此它不会在文档 XML 文件完成之前运行,但我不知道是什么。
I'm trying to post-process the documentation XML file as a post-build XSLT transformation (using the new XSLTransformation step), but the build fails with error Unable to execute transformation. Could not find file 'C:\...\documentation.XML'
. The documentation XML file shows up fine on disk after the build is complete, but during the AfterBuild step is simply not there: <Exec Command="dir $(ProjectDir)$(DocumentationFile)"/>
does not find the file, neither does <Exec Command="$(ProjectDir)$(DocumentationFile)"/>
.
The XslTransformation step is run from a task named AfterBuild
and declared as depending of the Compile
step. Apprently I'm missing something in the way this task is declared so that it does not run before the documentation XML file is complete, but I can't figure out what.
发布评论
评论(2)
这似乎是 IDE 构建系统中的一个错误,根据 http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/8a2f4af8-7a57-454f-aa7d-684f3f89acf3:IDE 版本重命名 < code>$(DocumentationFile) 在构建期间更改为 .tmp 文件,并在构建完成后将其重命名为正确的文档 XML 文件。我无法想象他们为什么要这么做,除了为了一个邪恶的项目经理的个人满足之外,他现在读到这篇文章时一定会笑得恶魔般的……
This seems to be a bug in the IDE build system, as per http://social.msdn.microsoft.com/Forums/en-US/msbuild/thread/8a2f4af8-7a57-454f-aa7d-684f3f89acf3: the IDE build renames the
$(DocumentationFile)
to .tmp file during the build, and renames it to the proper documentation XML file after the build is complete. I can't imagine why would they do that, other than for the personal gratification of an evil project manager who must have now laugh diabolically as it reads this...使用此目标声明,它对我来说效果很好:
您应该尝试删除对
Compile
步骤的依赖。It works fine for me, with this target declaration :
You should try to remove the dependency on
Compile
step.