I've followed the steps described here to modify the ProductCode and ProductVersion on my setup project on each build, using a prebuild event.
(meaning- I created a console application that uses the above-mentioned code to modify the .vdproj file, and I trigger it from the pre-build event).
The operation is successful, and after the build is done I can see that the 'Version' property of the setup project has changed.
However, the 'ProductVersion' property of the compiled msi does not change.
Only if I build the setup project again, I can see that the 'ProductVersion' has changed.
Is it possible that the prebuild event occurs after the msi is compiled?