Re: VS2005 "BuildDone" events
- I was just looking at this same problem. It's easily reproducable.
But the symptoms can vary depending on how thoroughly you test so
it's easily missed.
There are a number of bugs in VS2005 in the event parameters to the
OnBuildBegin and OnBuildDone events.
First, if you do a Rebuild, the Action parameter to OnBuildBegin
seems to always be vsBuildActionBuild. I've not yet seen the
appropriate vsBuildActionRebuildAll action.
Further, the OnBuildDone event's Action parameter will always be a
stale value from a prior build when a user selects the Rebuild
Solution command, but will be correct for the Build and Clean
For example, start VS2005 and perform a Rebuild Solution as the
first type of build. The Begin event action is vsBuildActionBuild
(which is incorrect) and the Done event action is zero (which is
Then perform a Clean Solution, the OnBuildBegin action is
vsBuildActionClean and the OnBuildDone action is also
vsBuildActionClean. This is correct.
However, if I immediately follow that with a Rebuild Solution, the
OnBuildBegin action is vsBuildActionBuild (incorrect again) but the
OnBuildDone action is still vsBuildActionClean (grossly incorrect).
When I immediately follow that with another Rebuild Solution, the
OnBuildBegin action is vsBuildActionBuild but the OnBuildDone action
is still vsBuildActionClean.
However, when I use the Build Solution command, not the Rebuild
Solution command, the OnBuildBegin action is vsBuildActionBuild but
the OnBuildDone action is still vsBuildActionBuild. Both are correct
but by now I've not a high degree of confidence in the Action
values. Maybe I was luckly or the ordering worked out.
It seems like the Rebuild Solution command doesn't pass the correct
Action parameter to either the OnBuildBegin or OnBuildDone events.
It appears to always be passing vsBuildActionBuild to the Begin
event and the prior Action to the Done event.
--- In email@example.com, "Carlos J. Quintero"
>generated for the
> Hi Anna,
> > The project was simple AppWizard generated MFC app we'd
> > purposes of testing an add-in with VS2005, and the build wasinitiated
> > manually using the Rebuild All command on the Build menu.and not 0.
> I can not reproduce using those steps. I get vsBuildActionBuild
> Best regards,
> Carlos J. Quintero
> MZ-Tools: Productivity add-ins for Visual Studio
> You can code, design and document much faster: