Bug 46539 - Unknown Identifier App when debugging
Summary: Unknown Identifier App when debugging
Status: RESOLVED DUPLICATE of bug 21742
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: 4.3.1 (C9SR1)
Assignee: Joaquin Jares
URL:
Depends on:
Blocks:
 
Reported: 2016-11-07 17:16 UTC by Lyndon Hughey
Modified: 2016-12-30 12:22 UTC (History)
6 users (show)

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


Attachments
Sample forms project (5.07 MB, application/zip)
2016-11-07 17:16 UTC, Lyndon Hughey
Details
AppUknown and global:AppIdentifyer empty pic (36.22 KB, image/png)
2016-12-21 15:42 UTC, Lyndon Hughey
Details


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 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:
Status:
RESOLVED DUPLICATE of bug 21742

Description Lyndon Hughey 2016-11-07 17:16:46 UTC
Created attachment 18356 [details]
Sample forms project

I'm noticing an issue where the debugger is not aware of the App object in xamarin forms projects.  This seriously hinders debugging because the App object is central to Forms.  Others have referenced the issue here:  https://forums.xamarin.com/discussion/79735/app-gives-unknown-identifier?


I've attached a sample project.  
You simply need to restore packages, then run the iOS project against a simulator.  
You can repeat the issue by setting a deubgging it on a simulator.  The 

The project is an empty project with the following changes:
1. Created a public static string in the App.cs file
2. Set the value of the static string in the App.cs file
3. Set a label's text property in the Main.xaml.cs file to the value of the static string.
4. Set a debugging breakpoint on the assignment of the label's text value (which is equal to the value of the static string).

I'm hoping for a quick resolution as this issue makes it very hard to develop.

My environment is as follows:

Mac MBPr running Parallels 12 with Windows10.1

Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Xamarin   4.2.0.719 (15694b9)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Forms Player   1.0
Preview Xamarin.Forms XAML on devices and simulators, with support for data-binding via JSON dummy view models.

Xamarin.Android   7.0.1.6 (5a02b03)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.2.0.4 (b638977)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 adrianknight89 2016-11-07 20:19:33 UTC
I'd say pretty much all of us have this issue. It's been around for a while.
Comment 2 Jason Smith [MSFT] 2016-11-22 20:58:09 UTC
Works for me when I put global::AppIdentifier.App.BaseString into the watch pad. Seems to be an issue with the debugger. Retargeting bug.
Comment 3 Lyndon Hughey 2016-11-23 05:49:05 UTC
I'm unable to get values using the "global::AppIdentifier.App" prefix in at least one of my projects.  The sample project I posted does display values using this method, however, an older project that has been updated to all of the current  packages does not work using that method.

Placing the prefix (along with the object name) simply displays a the name minus the "global::".  Also the Type column displays an odd '<namespace>" value.

For illustrative purposes:
My attempt to watch the value of a public static string called finaappId set (in the App.cs file of an older project) displays the following the in the watch window.


Name
-------
global::AppIdentifier.App.BucketList

Value
-------
AppIdentifier.App.BucketList

Type
-------
<namespace>


This project was tested on a different machine than the sample project.  It is a machine with a new Xamarin installation.  The interesting thing is that the sample project I posted does work on this machine.  Both projects have been updated to the newest packages  The details of machine's installation are as follows:

------------------
Microsoft Visual Studio Enterprise 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Xamarin   4.2.1.64 (872717c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.2.37 (ce955cc)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS   10.2.1.5 (44931ae)
Visual Studio extension to enable development for Xamarin.iOS.
--------------------------


The fact that the sample project works using the "global::AppIdentifier.App" prefix but the older project does not is a detail that I think you should be aware of. Thanks.
Comment 4 Lyndon Hughey 2016-12-21 15:42:50 UTC
Created attachment 18961 [details]
AppUknown and global:AppIdentifyer empty pic

This screenshot shows the output of a static App variable as being unknown.  It also shows the same variable with the fully qualified global::AppIdentifier prefix showing resolving to a point but not traversing the properties of the variable.  This makes the watch useless for App variables.
Comment 5 Lyndon Hughey 2016-12-21 15:45:09 UTC
I've updated the thread with a screenshot showing that the global:Appidentifier prefix in the watch is not traversing the properties of App class.

This is frustrating and has to be terribly frustrating to new developers to the platform.

Please let me know if you need anything additional from me to get this moving.
Comment 6 Jose Gallardo 2016-12-21 18:48:59 UTC
Moving the issue to Target Milestone C9SR1, to get it addressed soon.
Comment 7 Joaquin Jares 2016-12-30 12:22:36 UTC
This bug is a duplicate of 21742, which I'll be working on.

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