Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
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.
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.
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.
If we do a full check in FastNeedsBuilding, then yes, that's doable.
For more info, see http://msdn.microsoft.com/en-us/library/vstudio/ms171468(v=vs.120).aspx
*** Bug 21456 has been marked as a duplicate of this bug. ***
I fixed this.