Bug 30563 - VS debugger error when hitting iOS breakpoint
Summary: VS debugger error when hitting iOS breakpoint
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 3.11 (C5)
Hardware: PC Windows
: Normal normal
Target Milestone: 4.0.0 (C6)
Assignee: Bugzilla
Depends on:
Reported: 2015-05-28 20:22 UTC by David Schwegler
Modified: 2016-05-10 17:04 UTC (History)
18 users (show)

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

VS error dialog (19.79 KB, image/png)
2015-05-28 20:22 UTC, David Schwegler
Most recent VS log has the error (2.39 MB, application/x-zip-compressed)
2015-06-16 13:02 UTC, David Schwegler
Xamarin logs (1.59 MB, application/x-zip-compressed)
2015-07-08 04:30 UTC, Avidan Chen
A screenshot of the error message when debugging iOS. (19.81 KB, image/png)
2015-07-08 04:31 UTC, Avidan Chen

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:

Description David Schwegler 2015-05-28 20:22:24 UTC
Created attachment 11381 [details]
VS error dialog

1) Set a breakpoint in iOS code
2) Launch iOS app in debug mode
3) Hit breakpoint, then try to inspect or step through. 

VS doesn't crash, but it shows a dialog stating "EXCEPTION: System.ArgumentException: An item with the same key has already been added.". It freezes app execution, and I have to stop debugging the app. Attached is a screenshot. Let me know if there's other logs I can provide.

Possibly related to https://bugzilla.xamarin.com/show_bug.cgi?id=29897 ?

~~~~~~~~SYSTEM INFO~~~~~~~~~~

Mac: Xamarin.iOS v8.10.1.58 || Build Host v3.11.0.577


Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0447006-02468
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0447006-02468
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0447006-02468
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0447006-02468
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0447006-02468
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0447006-02468
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0447006-02468
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   06177-004-0447006-02468
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.4.51016.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 Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft 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.21010.0
For additional information, visit http://www.asp.net/

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

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

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.60318.734
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.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

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

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

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.11.576.0 (b28d0a1)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (2485523223ffb88567f101866d5f73da7a37ca53)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS (b39367de851067678f8b6fe4ab8a37ff97515cf8)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration
Comment 1 Danish Akhtar 2015-06-05 04:44:44 UTC
Hi David,

I have tried to reproduce this issue  with builds mentioned in bug but unable to reproduce it, we are successfully able to hit breakpoint and inspect variables in VS.

Could you please attach your sample and provide VS ide logs via VS->Help->Xamarin->Zip Xamarin logs ? 

Comment 2 David Schwegler 2015-06-16 13:02:49 UTC
Created attachment 11623 [details]
Most recent VS log has the error

Hi Danish,

I was working on other things recently, but I just ran the VS iOS debugger and got the error again, so I'm attaching the log. The log zip was too big to post, so I removed the log files that weren't from today and re-zipped it. Hope that's ok.

Comment 3 Avidan Chen 2015-07-08 04:29:21 UTC
I am encountering this issue as well, for some time now. I am currently running Xamarin 3.11.666.
Comment 4 Avidan Chen 2015-07-08 04:30:14 UTC
Created attachment 11927 [details]
Xamarin logs
Comment 5 Avidan Chen 2015-07-08 04:31:56 UTC
Created attachment 11928 [details]
A screenshot of the error message when debugging iOS.

This error pops up almost every debug session and I am unable to continue debugging afterwards.
Comment 8 Patrick Lind 2015-07-16 10:24:17 UTC
Same for me.  This reliably happens every time I am debugging an iOS app on Visual Studio.  Any updates on this?
Comment 11 Parmendra Kumar 2015-07-24 15:00:34 UTC
I have checked this issue and not able to reproduce this issue. To reproduce this issue I have follow steps mentioned in bug description and following code: 
List<int> list = new List<int>();
list.Add(2); list.Add(4); 
list.Add(3); list.Add(7); 
foreach (int prime in list) // Loop through List with foreach. 
{ Console.WriteLine(prime); } for (int i = 0; i < list.Count; i++) // Loop with for. 
{ Console.WriteLine(list[i]); } 

Please follow the Screencast: http://www.screencast.com/t/7UDu2HmNr It would be helpful to us if you provide test sample so that we can reproduce this issue at our end. 

Comment 12 Patrick Lind 2015-07-25 00:31:23 UTC
I'm not sure if this helps with your investigation but this happens to me ONLY when using the simulator.  If I use a physical device, I do not get this problem.
Comment 13 Ian Leatherbury 2015-08-24 18:53:53 UTC
Customer provided the following additional info, including screencast:

We are still experiencing this. Quite frustrating. Here is a screencast: http://screencast.com/t/71a2pEYNk7

It looks like if thread pool threads time out and then are recreated with the same name as before (the usual case!) it causes the error. After the error popup debugging is impossible until the app is restarted, and then the issue reoccurs randomly but frequently.

As a workaround I am forced to do most iOS development in Xamarin Studio instead.
Comment 15 PJ 2015-09-02 13:15:59 UTC
Joaquin says this is likely to be fixed in our upcoming C6 release, and no fix was applied for C5SR4. Updating milestone to match.