I was inadvertently responsible for a broken build this morning as I checked out a Setup Project last night in Visual Studio 2003 that ended up checking out a merge module that was included in the Setup. This merge module is built and subsequently stored in SourceSafe (I know – it shouldn’t be! – this is a temporary measure) by the build script, and the build failed as the .msm output file was checked out to me.
Shouldn’t Visual Studio prompt you when you check out?
The project was checked out in Visual Studio and it gave no warning that the .msm was also going to be checked out.
In other setup projects you’ll often find that other files will appear in the Check Out dialog (i.e. you’re about to check out all the ‘files‘ that have been explicitly included into your setup – from their source location). As a matter of course it’s wise to first untick everything (right at the top), and then select only the .vdproj file to actually check out.
Why didn’t it prompt in this case?
The problem in this case appears to be that the offender is a merge module and was added to the setup project as such rather than as an included ‘file’. It seems that Visual Studio neglects to mention merge modules when you check out as it probably thinks they’re static and not something it should worry you about! (which is probably true – yadayadayada)
How to prevent this happening to you
Well, while this file is still in VSS there’s little option but to just be vigilant whenever you check out a setup project that includes it. Either check out in VSS Explorer or if in Visual Studio -go immediately to VSS and undo the offending checkout. Another option is to add some more resilience into the build and somehow force an undo-checkout (as no one other than the build should be updating the file). A variation of this is to disallow checkout for all but the user running the build process through SourceSafe Admin (but this is a pain to administer), and the final and best solution is to remove the need to store the merge module in Source Control by sorting out cross-dependencies in different components so that they all pick the file up from the same central location.