Visual Studio增量生成:XML文档文件的创建为时已晚 [英] Visual Studio incremental build: XML documentation file is created too late
问题描述
我有一个Visual Studio 2005的DLL项目,该项目已打开"XML文档文件". 每当执行增量构建时,在执行构建后事件期间,输出目录中都不会存在XML文档文件.
I have a DLL project for Visual Studio 2005 that has "XML documetation file" turned on. Whenever I do an incremental build, during post-build event execution there is no XML documentation file in the output directory.
如果我在构建后事件期间暂停构建(使用来自
If I pause the build during post-build event (using sleep utility from GnuWin32 CoreUtils), I can see the file in the output directory with a name like vs5BB5.tmp. But this file is not renamed to MyLib.xml until post-build event (and "AfterBuild" target, as I have some customizations there) are finished.
对于Studio中的干净构建以及从命令行启动的MSBuild,一切都按预期工作-XML文档文件是在生成后事件之前创建的.
For a clean build in Studio and for MSBuild started from a command line everything works as expected - XML documentation file is created before post-build events.
为什么会发生这种情况,以及如何解决增量构建?
Why this happens, and how do I fix incremental builds?
推荐答案
只是遇到了同样的问题.这是Visual Studio和增量版本的一个已知问题.请参阅有关Microsoft connect的帖子.
Was just having the same issue. This is a known problem with Visual Studio and incremental builds. See this post on microsoft connect.
我使用如下条件的xcopy解决了该问题:
I solved it with a conditional xcopy like the one below:
if exist "$(TargetDir)$(TargetName).xml" xcopy $(TargetDir)$(TargetName).xml $(ProjectDir)......\bin\ /C /I /R /Y
if exist "$(TargetDir)$(TargetName).xml" xcopy $(TargetDir)$(TargetName).xml $(ProjectDir)......\bin\ /C /I /R /Y
SF
这篇关于Visual Studio增量生成:XML文档文件的创建为时已晚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!