I have been receiving this error for a while when using devenv on an automatic build. I have gone through every website I can find, and the usual answers mention refreshing dependencies (Which I believe fixes it for manual deployment, but not for automatic) and removing the source control coding from the projects, which hasn't helped me.
The error does not occur every time I build, but it seems random on different deployment projects each time.
Does anyone have any advice on why exactly this error occurs and how to go about fixing it?
This is a known issue in Visual Studio 2010 (a race condition). See this connect item.
We've run into this as well, and had a very unsatisfying support call on this issue with Microsoft. Long story short: it's a known issue, it won't be solved, and Microsoft advises to move away from Visual Studio Setup projects (.vdproj).
We've worked around this issue by triggering the MSI build a second time when it fails a first time. Not nice, but it works most of the time (error rate is down from ~ 10% to ~ 1%).