Closed tekskater closed 10 years ago
Thanks for the patch. I'll try to get it merged, tested and publish sometime this week.
That would be great. Thanks, and sorry for the primitive form of patch delivery.
Well, it's in. Try downloading v1.4 and see if it works for you. Thanks again.
It doesn't look like the patch was merged correctly. The "_canExecute = false;" at line 204 needs to be deleted otherwise the extension won't actually cancel the build if there is a failure.
It probably does not matter, but I had originally put lines 138 - 140 after line 145 (i.e. so that we don't add the new BeforeExecute handler for Build.Cancel until after we've added the handlers for OnBuildBegin and OnBuildDone).
Just to be clear, my version looks like:
//Since Visual Studio 2012 has parallel builds, we only want to cancel the build process once.
//This makes no difference for older versions of Visual Studio.
_buildEvents.OnBuildBegin += delegate { _canExecute = true; };
_buildEvents.OnBuildDone += delegate { _canExecute = false; };
//Following on from above, we need to intercept the Build.Cancel command to ensure that we only execute it once.
const string VSStd97CmdIDGuid = "{5efc7975-14bc-11cf-9b2b-00aa00573819}";
_buildCancel = _dte.Events.get_CommandEvents(VSStd97CmdIDGuid, (int)VSConstants.VSStd97CmdID.CancelBuild);
_buildCancel.BeforeExecute += new _dispCommandEvents_BeforeExecuteEventHandler(buildCancel_BeforeExecute);
Hi,
I am using your nice extension with Visual Studio 2012, but I find that Visual Studio often hangs if I manually cancel a parallel build that has errors because the StopOnFirstBuildError extension does not realize that the build was already canceled and tries to cancel it a second time. Here is a patch to StopOnFirstBuildErrorPackage.cs that fixes this problem by ensuring that Build.Cancel is only invoked once:
56a57
Thanks.