How can I prevent a .vdproj compile from updating the PackageCode on every compile?

4.2k views Asked by At

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?

2

There are 2 answers

2
Kris Vandermotten On

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

2
yzorg On

This is the first useful google hit when searching for the infinite dialog message after installing VS2010 SP1 and building a solution with setup projects (.vbproj). This has been fixed by MS. I'm posting a more direct link to the hotfix download.

A hotfix for SP1 has been made available.

http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=35848

Read the hotfix link, as you still have to modify the project properties so the default build action doesn't try to change the product code on every build (see the project property added by the hotfix: BackwardCompatibleIDGeneration).