Bug 21456 - "Outdated Debug Information" dialog shown when project was just rebuilt
Summary: "Outdated Debug Information" dialog shown when project was just rebuilt
Status: RESOLVED DUPLICATE of bug 12951
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Debugger ()
Version: 5.0
Hardware: PC Windows
: Normal normal
Target Milestone: master
Assignee: Jeffrey Stedfast
Depends on:
Reported: 2014-07-19 05:40 UTC by Matt Ward
Modified: 2014-07-21 21:58 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 Matt Ward 2014-07-19 05:40:50 UTC
To reproduce:

1) In Preferences/Projects/Build untick the "Build solution before running" option. This needs to be disabled.
2) Create a new C# console application.
3) Rebuild the entire solution.
4) Select Run/Start Debugging.

Expected result:

Application starts debugging.

Actual result:

The "Outdated Debug Information" dialog shows even though I just built the solution.

Debugging the code the DebugCommands.CheckBeforeDebugging method is called:

internal static CheckResult CheckBeforeDebugging (IBuildTarget target)
	if (IdeApp.Preferences.BuildBeforeExecuting)
		return CheckResult.BuildBeforeRun;
	if (!target.NeedsBuilding (IdeApp.Workspace.ActiveConfiguration))
		return CheckResult.Run;

The first if is skipped over since BuildBeforeExecuting is disabled.
The problem is that the target.NeedsBuilding returns true. Debugging this the target is an SolutionItem. Now the SolutionItem.NeedsBuilding always returns true.

[Obsolete ("This method will be removed in future releases")]
public bool NeedsBuilding (ConfigurationSelector configuration)
	return true;

Should DebugCommands be using another method which is not marked as obsolete?
It looks like MonoDevelop should be using the ProjectServiceExtension.GetNeedsBuilding (IBuildTarget item, ConfigurationSelector configuration) instead. That has an implementation in the Project class which checks the files in the project have been changed since the last build so it looks like it should not show the Outdated Debug Information dialog.
Comment 1 Udham Singh 2014-07-21 06:29:26 UTC
I have checked this issue with steps provided in bug description and observed the same behavior mentioned in bug. Please refer the screencast : http://www.screencast.com/t/FsMslV2mYpQK

Environment Info : 

=== Xamarin Studio ===

Version 5.1.4 (build 0)
Installation UUID: 312d4e9a-339c-433f-a27b-88ce0777af8f
	Microsoft .NET 4.0.30319.34014
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.25

=== Xamarin.Android ===

Version: 4.14.0 (Enterprise Edition)
Android SDK: D:\SDK\AndroidSDK
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		3.2   (API level 13)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_31
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode)

=== Build Information ===

Release ID: 501040000
Git revision: 7d45bbe2ee22625f125d0c52548524f02d005cca
Build date: 2014-07-14 13:38:46-04
Xamarin addins: c78f1d88e57baa928aeee1484d96e6f8edf8de33

=== Operating System ===

Windows 6.2.9200.0 (64-bit)
Comment 2 Mikayla Hutchinson [MSFT] 2014-07-21 21:58:10 UTC

*** This bug has been marked as a duplicate of bug 12951 ***