Bug 56950 - Debugger doesn't show details of NotImplementedException() on Xamarin.iOS from VS2017.
Summary: Debugger doesn't show details of NotImplementedException() on Xamarin.iOS fro...
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: XI 10.10 (d15-2)
Hardware: PC Windows
: --- normal
Target Milestone: 15.2
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-05-30 02:07 UTC by Stone Chen
Modified: 2017-06-06 15:55 UTC (History)
5 users (show)

Tags:
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:
Status:
RESOLVED INVALID

Description Stone Chen 2017-05-30 02:07:28 UTC
In any Xamarin.iOS project, when I debug in VS2017 (15.2.26430.6), everything keep updated.

When I try to throw a NotImplementedException(), the debugger doesn't show the details of exception, and just a general unexpected exception.

Code sample:
        private void Iostest_OnClicked(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

Debugger shows:

unexpected exception.


Expected Debugger shows:

unexpected exception -The method or operation is not implemented.

iOS simulator and iDevice can reproduce it too. Android doesn't have such issue.


---------------------------------------------------------------------------------------------

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.6) Release
VisualStudio.15.Release/15.2.0+26430.6
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools   00369-60000-00001-AA066
Microsoft Architecture Diagrams and Analysis Tools

Visual Basic 2017   00369-60000-00001-AA066
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA066
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA066
Microsoft Visual C++ 2017

Visual F# 4.1   00369-60000-00001-AA066
Microsoft Visual F# 4.1

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

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

Dotfuscator Community Edition   5.27.0.4679-release+ce-vs15.e4937ba.20161216.158
PreEmptive Protection - Dotfuscator CE

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

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

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

MenuCommands Extension   1.0
MenuCommands Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Hive Query Language Service   2.2.5000.0
Language service for Hive query

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.3.50417.1
Adds support for developing and debugging Node.js apps in Visual Studio

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

Office Developer Tools for Visual Studio 2017 ENU   15.0.26309
Microsoft Office Developer Tools for Visual Studio 2017 ENU

Redgate ReadyRoll   1.13.22.3147
Extend DevOps processes to your SQL Server databases and safely automate database deployments.
    
Visit https://www.red-gate.com/readyroll for more information.

Copyright (C) 2011 Red Gate Software Ltd. All rights reserved.
  
This software contains components from Component Owl.
SQL Server is a registered trademark of Microsoft Corporation. 
Visual Studio is a registered trademark of Microsoft Corporation. 

ReadyRoll contains code from the following open source software:

NuGet https://www.nuget.org/
SQL LocalDB Wrapper https://github.com/martincostello/sqllocaldb
Autofac https://autofac.org/
Json.NET https://json.net/
MahApps.Metro http://mahapps.com/
SemVer https://github.com/maxhauser/semver
Menees Diff Controls http://www.menees.com/
Log4Net http://logging.apache.org/log4net/
Extended WPF Toolkit https://wpftoolkit.codeplex.com/
Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX
OctoPack https://github.com/OctopusDeploy/OctoPack
SQLite https://sqlite.org/

This product contains icons from http://www.visualpharm.com distributed under a free backlink license.

For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the ReadyRoll application folder.
    

Redgate SQL Prompt   7.4.1.767
Write, format, and refactor SQL effortlessly

Redgate SQL Search   2.3.10.1131
Search functionality for SQL Server databases, from within Visual Studio

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript   2.2.2.0
TypeScript tools for Visual Studio

Visual C++ for Cross Platform Mobile Development (Android)   15.0.26228.00
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS)   15.0.26228.00
Visual C++ for Cross Platform Mobile Development (iOS)

Visual C++ for Linux Development   1.0.6
Visual C++ for Linux Development

Visual Studio Tools for Apache Cordova   15.113.6201.1
Visual Studio Tools for Apache Cordova

Visual Studio tools for CMake   1.0
Visual Studio tools for CMake

Visual Studio Tools for Unity   3.1.0.0
Visual Studio Tools for Unity

Visual Studio Tools for Universal Windows Apps   15.0.26430.06
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.5.0.443 (c871575)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK   7.3.0.13 (448f54f)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK   10.10.0.30 (30b6e87)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 1 Stone Chen 2017-05-30 02:09:16 UTC
Please check it asap. Customer is having bigger business impact.
Comment 2 Stone Chen 2017-05-30 02:38:16 UTC
After test, it is related with the link option.

When set to 'Don't Link', debugger will shows the details of exception.

When set to other link option such as 'Link SDK only', debugger won't show the details.
Comment 3 Stone Chen 2017-05-30 06:32:20 UTC
General unexpected exception without details:
https://youtu.be/TFUQZ5KWZ-Y

Expected details:
https://youtu.be/3tCQeHXxpv0

Sample project:
https://drive.google.com/open?id=0Bx1oqTVcpcd2SGFBR1J4eUx4S0k
Comment 4 Manuel de la Peña [MSFT] 2017-05-31 16:38:59 UTC
Hello,

This seems to be an issue with the Visual Studio (on Windows) plugin since on Visual Studio for Mac we get the following information using the "Link Frameworks SDKs only":

System.NotImplementedException: Iostest_OnClicked
  at App2.MainPage.Iostest_OnClicked (System.Object sender, System.EventArgs e) [0x00001] in /Users/mandel/Downloads/App2/App2/App2/MainPage.xaml.cs:21
  at Xamarin.Forms.Button.Xamarin.Forms.IButtonController.SendClicked () [0x00016] in <42fe931976e64c199eddde45068a6c09>:0
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Renderers\ButtonRenderer.cs:91
  at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/1381/7571635e/source/xamarin-macios/src/UIKit/UIControl.cs:38
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1381/7571635e/source/xamarin-macios/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/1381/7571635e/source/xamarin-macios/src/UIKit/UIApplication.cs:63
  at App2.iOS.Application.Main (System.String[] args) [0x00001] in /Users/mandel/Downloads/App2/App2/App2.iOS/Main.cs:17

And the following info with the "Link all" options:

System.NotImplementedException: Iostest_OnClicked
  at App2.MainPage.Iostest_OnClicked (System.Object sender, System.EventArgs e) [0x00001] in /Users/mandel/Downloads/App2/App2/App2/MainPage.xaml.cs:21
  at Xamarin.Forms.Button.Xamarin.Forms.IButtonController.SendClicked () [0x00020] in <42fe931976e64c199eddde45068a6c09>:0
  at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x00000] in C:\BuildAgent\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Renderers\ButtonRenderer.cs:91
  at UIKit.UIControlEventProxy.Activated () [0x00007] in /Users/builder/data/lanes/1381/7571635e/source/xamarin-macios/src/UIKit/UIControl.cs:38
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1381/7571635e/source/xamarin-macios/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/1381/7571635e/source/xamarin-macios/src/UIKit/UIApplication.cs:63
  at App2.iOS.Application.Main (System.String[] args) [0x00001] in /Users/mandel/Downloads/App2/App2/App2.iOS/Main.cs:17

I'll erasing this bug to the VS team.
Comment 5 Joaquin Jares 2017-05-31 19:17:00 UTC
The bug is in the linker. The handling of mdbs is not correct and incompatible with VS. This has been happening forever. I'm assigning back to iOS, as there is nothing I can do to fix that.
Comment 6 Stone Chen 2017-06-01 01:12:51 UTC
As feedback from partner, even if using VS for Mac, it still happen using iPhone as  device target instead of iOS simulator.
Comment 7 Manuel de la Peña [MSFT] 2017-06-05 09:16:47 UTC
@Stone can you please provide the version of the VS for Mac used for the testing. I have tested this with mac and as I mentioned in the previous comment, I got the correct feedback.

I'd like to know the exact version to try and reproduce the issue.

@Joaquin is that true? Have we never been able to debug in VS for windows? In XS we have never had a problem AFAIK.
Comment 8 Stone Chen 2017-06-05 13:36:37 UTC
Customer is telling that it is resolved by latest VS 2017 15.2 (26430.12). So I will close this incident.
Comment 9 Manuel de la Peña [MSFT] 2017-06-06 15:55:11 UTC
@Stone closing this for you.