Bug 12951 - Fast "needs build" check before running/debugging
Summary: Fast "needs build" check before running/debugging
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: PC Mac OS
: Normal enhancement
Target Milestone: master
Assignee: Lluis Sanchez
: 21456 ()
Depends on:
Reported: 2013-06-28 19:16 UTC by Mikayla Hutchinson [MSFT]
Modified: 2015-02-24 23:02 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mikayla Hutchinson [MSFT] 2013-06-28 19:16:02 UTC
VS has a feature called "FastUpToDateCheck" that allows it to check whether a project needs building without invoking MSBuild. This can be disabled by a property in the project file called DisableFastUpToDateCheck:

AFAIK, VS uses the "fast check" when determining whether to build a project before debugging, unless DisableFastUpToDateCheck is true.

We recently deprecated our IBuildTarget.NeedsBuilding mechanism, since when projects actually needed building, it made the it build slower - MSBuild does internal dependency checking when building - and didn't always accurately match MSBuild. However, this means repeated debugging is slower since we always invoke MSBuild before running the app.

IMO we should add a new FastNeedsBuilding method, used only to check whether the app needs building before debugging. This would return true if DisableFastUpToDateCheck is set (for VS compatibility), else it would return true if OnGetLastBuildTime was older than any ProjectFile in the project.
Comment 1 Lluis Sanchez 2013-06-29 05:27:16 UTC
I don't see how this will help. If the new FastNeedsBuilding only checks OnGetLastBuildTime, then you can only rely on its result if it returns true, in which case you'll end invoking msbuild to build the project. If it returns false, we also need to call msbuild to do the full dependency check. So in any case we have to call msbuild. This can only work if FastNeedsBuilding does a complete check on the project and all dependencies, but that's what we were doing with the deprecated IBuildTarget.NeedsBuilding.
Comment 2 Mikayla Hutchinson [MSFT] 2013-07-01 13:56:47 UTC
The fast check should in most cases be good enough to determine whether the project needs building before executing. There's no need to fall back to MSBuild for an accurate check. If users want an accurate check, they can opt in via the DisableFastUpToDateCheck property.
Comment 3 Lluis Sanchez 2013-07-03 03:54:25 UTC
If we do a full check in FastNeedsBuilding, then yes, that's doable.
Comment 4 Mikayla Hutchinson [MSFT] 2014-02-27 15:04:08 UTC
For more info, see http://msdn.microsoft.com/en-us/library/vstudio/ms171468(v=vs.120).aspx
Comment 5 Mikayla Hutchinson [MSFT] 2014-07-21 21:58:10 UTC
*** Bug 21456 has been marked as a duplicate of this bug. ***
Comment 6 Mikayla Hutchinson [MSFT] 2015-02-24 23:02:25 UTC
I fixed this.