Bug 21742 - Debugger shows Unknown Identifier for Static/Constant values in Class Libraries
Summary: Debugger shows Unknown Identifier for Static/Constant values in Class Libraries
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 3.1
Hardware: PC Windows
: Normal normal
Target Milestone: 15.1
Assignee: Joaquin Jares
URL:
: 46539 ()
Depends on:
Blocks:
 
Reported: 2014-07-31 17:27 UTC by Jon Goldberger [MSFT]
Modified: 2017-04-06 13:37 UTC (History)
20 users (show)

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


Attachments
Test Project (32.41 KB, application/zip)
2014-07-31 17:27 UTC, Jon Goldberger [MSFT]
Details
Xamarin Android project to identify and reproduce the issue, with work-arounds. See my related comment. (20.54 KB, application/x-zip-compressed)
2016-04-03 22:30 UTC, Robert Bruce
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:
VERIFIED FIXED

Description Jon Goldberger [MSFT] 2014-07-31 17:27:52 UTC
Created attachment 7555 [details]
Test Project

This is similar to bug 10918, but that had to do with iOS. I am seeing the same issue using with an Android app in Visual Studio.

To reproduce:

1. Open the attached test project and set the TestStaticDebug project as the startup project.
2. Open the MainActivity.cs file and place a breakpoint on kine 22, if (!string.IsNullOrEmpty(Data.DeviceID))
3. Launch the app
4. When the breakpoint is hit, hover over Data.Device ID

Expected result: should see info about that Type and the DeviceID member (null at this point)
Actual result: shows Data: Unknown Identifier

Moving the Class1.cs file out of the ClassLibrary1 project and into the TestStticDebug project does _not_ result in this issue. This issue does _not_ occur with a Xamarin.iOS project in Visual Studio. (Run the TestStaticDebug.iOS project to confirm) Also this issue did _not_ appear when testing in Xamarin Studio on a Mac for either an Android or iOS project.
Comment 1 Jon Goldberger [MSFT] 2014-07-31 17:28:29 UTC
Oh, and my version info:

Microsoft Visual Studio Ultimate 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0451031-02209
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0451031-02209
Microsoft LightSwitch for Visual Studio 2013

Office Developer Tools - May 2014 Update ENU   06181-004-0451031-02209
Microsoft Office Developer Tools for Visual Studio 2013 - May 2014 Update ENU

Team Explorer for Visual Studio 2013   06181-004-0451031-02209
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0451031-02209
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0451031-02209
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0451031-02209
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0451031-02209
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0451031-02209
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06181-004-0451031-02209
Windows Phone SDK 8.0 - ENU

ASP.NET and Web Tools   2013.2.50425
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.1.20409.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.1
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

NuGet Package Manager   2.8.50313.46
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

RemObjects Data Abstract   8.0.81.1131
RemObjects Data Abstract
Copyright 2002-2014 RemObjects Software, LLC. All rights reserved.
http://www.remobjects.com/da

RemObjects Everwood   4.3.57.563
RemObjects Everwood
Copyright 2003-2014 RemObjects Software, LLC. All rights reserved.
http://www.remobjects.com/everwood

RemObjects SDK   8.0.81.1131
RemObjects SDK
Copyright 2002-2012 RemObjects Software, LLC. All rights reserved.
http://www.remobjects.com/ro

SAPReferenceManager   1.0
Manages References to Shared Projects

SQL Server Data Tools   12.0.40403.0
Microsoft SQL Server Data Tools

Windows Azure Mobile Services Tools   1.1
Windows Azure Mobile Services Tools

Windows Azure Tools   2.3
Windows Azure Tools for Microsoft Visual Studio 2013 - v2.3.20320.1602

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.1.228.0 (2349ba7b70529ea26ba842e1ec32d054bd6abb3b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android
Comment 2 Dan Rigby 2014-07-31 17:40:43 UTC
I am experiencing this issue in the project I'm currently working on. As Jon indicated it seems to affect only Visual Studio, only when using Xamarin.Android, only when accessing a static class in a library. Thanks.
Comment 3 Dan Rigby 2014-07-31 17:42:04 UTC
My version information:

Microsoft Visual Studio Ultimate 2013
Version 12.0.30626.00 Update 3 RC
Microsoft .NET Framework
Version 4.5.51650

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0451022-02778
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0451022-02778
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06181-004-0451022-02778
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0451022-02778
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0451022-02778
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0451022-02778
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0451022-02778
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0451022-02778
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06181-004-0451022-02778
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.3.50624.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.20609.0
For additional information, visit http://www.asp.net/

Code alignment   9.2
Code alignment is a practice for formating your code.
Based on principals from maths and other displines, code alignment gives extra meaning to your code by lining up similar code parts into columns.
This is a practice everyone performs on most data using tables and spreadsheets, but unfortunately doesn't get applied to code often enough.

Common Azure Tools   1.1
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

JetBrains ReSharper 8.2.1   C# Edition build 8.2.1000.4556 on 2014-05-19T16:12:38
JetBrains ReSharper 8.2.1 package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper/. Copyright © 2003–2014 JetBrains, Inc.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Team Foundation Server 2013 Power Tools   12.0
Power Tools that extend the Team Foundation Server integration with Visual Studio.

Microsoft Visual Studio Process Editor   1.0
Process Editor for Microsoft Visual Studio Team Foundation Server

Multiline Search and Replace   1.5
Adds multiline search and replace functionality to Visual Studio.

Multilingual App Toolkit   3.1.1085.0
Multilingual App Toolkit helps you localize your Windows Store app by providing file management, pseudo and machine translation, translation editor, and build integration. http://go.microsoft.com/fwlink?linkid=245767

NuGet Package Manager   2.8.50313.46
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30619
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SAPReferenceManager   1.0
Manages References to Shared Projects

SQL Server Data Tools   12.0.40706.0
Microsoft SQL Server Data Tools

StopOnFirstBuildError   1.0
StopOnFirstBuildError

Stops a solution build immediately after a project has failed to build.

http://tech.einaregilsson.com/2011/01/06/stop-build-on-first-error-in-visual-studio-2010/

Windows Azure Mobile Services Tools   1.1
Windows Azure Mobile Services Tools

Windows Azure Tools   2.3
Windows Azure Tools for Microsoft Visual Studio 2013 - v2.3.20320.1602

Windows Azure Tools   2.2
Windows Azure Tools for Microsoft Visual Studio 2013 - v2.2.11003.1601

Windows Installer XML Toolset   3.8.1128.0
Windows Installer XML Toolset version 3.8.1128.0
Copyright (c) Outercurve Foundation. All rights reserved.

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.3.46.0 (6029dc7c3575b82aca148081256b768c09a6c06e)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

XAML Spy   2.3.1
XAML Spy for Visual Studio
Copyright © First Floor Software. All rights reserved.

Spy all the XAML!
http://xamlspy.com

XamlStylerVSPackage   1.0
Xaml Styler.

Git Extensions
Git Extensions is a graphical interface for Git
For more information about Git Extensions, see the Git Extensions website at
http://code.google.com/p/gitextensions/
Copyright © 2012 Henk Westhuis
Comment 4 Rajneesh Kumar 2014-08-01 04:09:00 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps mentioned in bug description. Please refer the screencast : http://screencast.com/t/bWub8Mwpn

Environment Info:

Windows 8
VS 2013
Xamarin   3.1.228.0 (2349ba7b70529ea26ba842e1ec32d054bd6abb3b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android
Comment 5 Daniel Cazzulino 2014-08-07 12:25:03 UTC
Maybe something that could be fixed as part of the debugger work we're doing on the VS side? Copying joj...
Comment 6 Robert Bruce 2016-04-03 22:30:54 UTC
Created attachment 15590 [details]
Xamarin Android project to identify and reproduce the issue, with work-arounds.  See my related comment.
Comment 7 Robert Bruce 2016-04-03 22:32:15 UTC
I have identified scenarios which lead to this issue, as well as work-arounds for some.

See the project I just uploaded for full details.

Essentially, the physical file locations of the classes (and calling classes) in the project lead to the issue.

Additionally, the class must be fully qualified with the namespace for a successful work-around, but that only works in some of the scenarios.  From OnCreate()...

Console.WriteLine(MyClass.MyString);            // Unqualified
Console.WriteLine(App1.MyClass.MyString);       // Fully Qualified with namespace

/*
Set a break point on the "Console.WriteLine()" lines above and you'll get the 
"Unknown identifier: MyStaticClass" error when trying to inspect under specific conditions...

File Locations                      Unqualified             Fully Qualified
------------------------------      ---------------------   --------------------
MainActivity.cs in root,
MyClass.cs in sub-folder            "Unknown identifier"    Inspection Works

MainActivity.cs in sub-folder,
MyClass.cs in root                  Inspection Works        Inspection Works

Both in root                        Inspection Works        Inspection Works

Both in different sub-folders       "Unknown identifier"    "Unknown identifier"
            
Both in same sub-folder             "Unknown identifier"    "Unknown identifier"

*/

I also discovered that the issue happens on non-static classes with static members.

Hope this helps,
 
Robert


My Version Information:

Microsoft Visual Studio Professional 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Professional

LightSwitch for Visual Studio 2015   00322-40000-00000-AA376
Microsoft LightSwitch for Visual Studio 2015

Visual Basic 2015   00322-40000-00000-AA376
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA376
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA376
Microsoft Visual C++ 2015

Visual F# 2015   00322-40000-00000-AA376
Microsoft Visual F# 2015

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.6
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JetBrains ReSharper Ultimate 10   Build 104.0.20151101.164448
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure HDInsight HQL Service   2.0.2600.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.2600.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.7
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.7.30818.1601

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2015 ENU   14.0.23025
Microsoft Office Developer Tools for Visual Studio 2015 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio   2.2.31124.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration   2.2.31124.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support   2.2.31124.00
Profiling support for Python projects.

SQL Server Data Tools   14.0.50730.0
Microsoft SQL Server Data Tools

TypeScript   1.7.6.0
TypeScript for Microsoft Visual Studio

Visual Studio Tools for Apache Cordova   Update 5
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   4.0.1.147 (1cc3a99)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.2.1 (46c3f7e)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.4.2.28 (686b410)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 8 Adam 2016-09-16 22:22:12 UTC
I'm getting this too. On 2 XS installations on 2 different Macs.
I've actually been getting this for several months, but never as bad as I am now. It's an absolute PITA...
Comment 9 thomas 2016-10-25 14:46:48 UTC
Will this be fixed at all? It's known for 2 years know?
Comment 10 philip 2016-10-27 20:54:54 UTC
Yes, this really causes problems during debugging and has been around for sooooo long!
Comment 11 Joaquin Jares 2016-12-30 12:22:36 UTC
*** Bug 46539 has been marked as a duplicate of this bug. ***
Comment 12 Joaquin Jares 2016-12-30 12:23:04 UTC
I'm assigning this to me to work on.
Comment 13 Joaquin Jares 2017-01-12 17:32:24 UTC
This is now fixed and will be available in our next release.
Comment 14 Fredy Wenger 2017-02-06 14:30:30 UTC
@Joaquin Jares
In WHICH version of what "peace of software" the bug should be fixed?
As this is an extremely ugly bug for many users:
- Please post a detailed advice here, which software versions have to be updated
  to fix the problem, as soon as the bug IS FIXED
Thanks
Comment 15 Lyndon Hughey 2017-03-07 00:06:28 UTC
I'd also like to know what version this is fixed in.  I'm still having this issue and I've updated the Xamarin Visual Studio extension at least once since your post. 

I'm running 
Xamarin   4.3.0.784 (73f58d6)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Comment 16 Neha Kharbade 2017-03-17 13:59:47 UTC
verified on

Microsoft Visual Studio Ultimate 2013
Version 12.0.40629.00 Update 5
Microsoft .NET Framework
Version 4.6.01055
Xamarin   4.3.1.39 (a70e3a1)
Xamarin.Android   7.2.0.1 (ff38526)
Xamarin.iOS   10.8.0.17 (49a63dc)

and working fine so marking as verified
Comment 17 Lyndon Hughey 2017-03-24 02:04:53 UTC
Thank you for posting the version.  I see that the version you've verified it on is still in the beta channel.  I'll load that now.  It was hard to discern if the "next version" that Joaquin referred to in mid January had been released or not. Thanks!
Comment 18 Nicolas Belley 2017-04-06 13:37:22 UTC
Verifed and still really pissed at it on:

Microsoft Visual Studio Professional 2017 (Test)
Version 15.1 (26403.0) Release
VisualStudio.15.Release/15.1.0+26403.0
Microsoft .NET Framework
Version 4.7.02046