I have a Visual Studio 2010 solution for a Web Application that contains all of the projects that make up the Web Application, plus the .vdproj file that builds the installer. All of the files are under configuration management.
Whenever I compile this solution with no changes in any source code, Visual Studio will check out the .vdproj file and make changes. At a minimum, the PackageCode will be changed to a to a different GUID. At other times it will change the order of the Hierarchy within the "DeployProject" section of the .vdproj file in addition to updating the PackageCode.
This does not happen with any of our other .vdproj files. One thing that makes this .vdproj unique is that in addition to containing the primary output from the other projects in the solution, it contains over 50 additional .iso, .kml, .jpg files that do not originate from a visual studio project. Could these be causing the PackageCode to change in some way?
The package code should be changed each time you "release" an msi, see http://msdn.microsoft.com/en-us/library/Aa370568. Since VS doesn't know whether you will distribute this msi or not, it plays safe and modifies the package code.
Visual Studio should be able to handle this in combination with source control, and you're lucky it does that for you (in a way, apparently). Visual Studio 2010 SP1 has a problem there, see http://connect.microsoft.com/VisualStudio/feedback/details/650587/vs-2010-sp1-changes-packagecode-in-vdproj-on-each-build-but-fails-as-source-controlled