views:

533

answers:

2

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.

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?

+2  A: 

Was just having the same issue. This is a known problem with Visual Studio and incremental builds. See this post on microsoft connect.

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

SF

A Guy From Ottawa
Thanks for a good answer.Unfortunately, I can't mark it as accepted due to "unresolved bounty" problem (http://meta.stackoverflow.com/questions/1413).
VladV
A: 

Just having this problem myself....

what I found is that the xml file is named a .tmp file, so you can copy this tmp file to where you want, its just a bit of a "messy" work around.

I'm also quite tempted to write myself a command line tool thats called something like :-

WaitForThenCopy <source path> <target path> <milliseconds to wait>

only problem is it would have to be non blocking and you wouldn't know if it worked or not.

Keith Nicholas