Bug 31603 - First attempt to open a storyboard after disconnecting and reconnecting to build host fails during "CoreSimulator.get_SupportedRuntimes()"
Summary: First attempt to open a storyboard after disconnecting and reconnecting to bu...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS Designer ()
Version: 3.11 (C5)
Hardware: PC Windows
: High major
Target Milestone: 4.0.0 (C6)
Assignee: Danish Akhtar
URL:
: 31786 ()
Depends on:
Blocks:
 
Reported: 2015-07-02 21:50 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-08-25 16:22 UTC (History)
10 users (show)

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


Attachments
Log files and version information (15.29 KB, application/zip)
2015-07-02 21:50 UTC, Brendan Zagaeski (Xamarin Team, assistant)
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 Brendan Zagaeski (Xamarin Team, assistant) 2015-07-02 21:50:28 UTC
Created attachment 11835 [details]
Log files and version information

First attempt to open a storyboard after disconnecting and reconnecting to build host fails during "CoreSimulator.get_SupportedRuntimes()"




## Regression status: Regression between XVS 3.9 and XVS 3.11

BAD:  XamarinVS 3.11.666.0 (ebae43a) + Xamarin.iOS 8.10.2.37  (ef8c2f7)
BAD:  XamarinVS 3.11.590.0 (5160db7) + Xamarin.iOS 8.10.1.64  (e6ebd18)
GOOD: XamarinVS 3.9.547.0  (20fd2f0) + Xamarin.iOS 8.9.1.3    (f7736a4)




## "Workaround"

After the first failed attempt to open the storyboard, close the storyboard and double-click it again. This seemed to succeed every time in my tests.




## Steps to reproduce


1. Create a new "Visual C# -> iPhone -> iOS -> Single View App" template project.

2. Click the build host "disconnect" in the VS toolbar.

3. Click the build host "refresh" button in the VS toolbar to reconnect. (Select the Mac build host from the connection dialog if necessary.)

4. Shortly after connecting, double-click "MainStoryboard.storyboard" to open the file in the iOS designer.

5. Wait until an error dialog appears. (This should happen quite quickly after opening the storyboard. If you see the loading spinner for a couple seconds, you can move to step 6 immediately.)

6. Repeat steps 2-5 a few times if needed to hit the error.




## Results

The storyboard displays an alert dialog "The remote server returned an error: (500) Internal Server Error."


### Excerpts of the errors from mtbserver.log

> [02-Jul-2015 21:09:41] Exception: Exception type: System.Reflection.TargetInvocationException
> Exception has been thrown by the target of an invocation.
>   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
>   at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
>   at MonoTouch.Hosting.IntPtrEx.To[SingletonSimRuntime[]] (IntPtr ptr) [0x00000] in <filename unknown>:0 
>   at MonoTouch.Hosting.Library64.Call[SingletonSimRuntime[]] (System.Linq.Expressions.MemberExpression expr) [0x00000] in <filename unknown>:0 
>   at MonoTouch.Hosting.Library64.Call[SingletonSimRuntime[]] (System.Linq.Expressions.LambdaExpression expr) [0x00000] in <filename unknown>:0 
>   at Bindings.CoreSimulator.get_SupportedRuntimes () [0x00000] in <filename unknown>:0 

> [02-Jul-2015 21:09:41] Exception: Exception type: System.InvalidCastException
> Cannot cast from source type to destination type.
>   at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
>   at MonoTouch.Hosting.IntPtrEx.To[SingletonSimRuntime] (IntPtr ptr) [0x00000] in <filename unknown>:0 
>   at Foundation.NSArray.ArrayFromHandleFunc[SingletonSimRuntime] (IntPtr handle, System.Func`2 createObject) [0x00000] in <filename unknown>:0 
>   at MonoTouch.Hosting.IntPtrEx.FromNSArray[SingletonSimRuntime] (IntPtr ptr) [0x00000] in <filename unknown>:0 
>   at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
>   at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 




## Version information (brief)



### Windows 8.1 (64-bit) in VMWare Fusion 6.0.6 (2684343) 

- 2 CPU cores allocated

- "Enable hypervisor" disabled



### XamarinVS

Xamarin   3.11.666.0 (ebae43a)



### OS X 10.10.3 MacBook Air 5,2

Xamarin.iOS 8.10.2.37 (ef8c2f7)
Mono 4.0.2 (detached/c99aa0c)

Xcode 6.3.2 (7718), Build 6D2105
Comment 2 Saurabh 2015-07-03 01:34:00 UTC
I am also able to reproduce this Issue

Error details: https://gist.github.com/saurabh360/f412cd007daede6d063b
VS Trace Log: https://gist.github.com/saurabh360/c745af0a818722b53d83
iOS Designer: https://gist.github.com/saurabh360/31431ab02b5ac48dca4b

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

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0444002-02633
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0444002-02633
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0444002-02633
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0444002-02633
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0444002-02633
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0444002-02633
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0444002-02633
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-0444002-02633
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.

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

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.50926.663
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.666.0 (ebae43a)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.4.16 (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
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   8.10.2.0 (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
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

X.iOS 8.10.2.37
Comment 3 Alan McGovern 2015-07-09 09:46:54 UTC
*** Bug 31786 has been marked as a duplicate of this bug. ***
Comment 4 Alan McGovern 2015-07-09 09:48:16 UTC
cycle 5 will not be receiving patches for this. The codebase has diverged too much
Comment 5 Alan McGovern 2015-07-09 10:10:17 UTC
I need the logs from any mtbs build with this commit: https://github.com/xamarin/md-addins/commit/93451149b274143bbff0a67c682cd170a1611552 .

This build should tell us the type of the object which Xamarin.Mac gave us and also the expected object type. They should always match except if there is a bug in reference counting in Xamarin.Mac itself.
Comment 6 Alan McGovern 2015-07-09 10:29:21 UTC
A build with https://github.com/xamarin/md-addins/commit/bcfca40314edcecccbc671548965bc2af94d6148 or newer might fix the bug. I removed a workaround for an old Xamarin.Mac bug. Perhaps that workaround is now causing trouble.

If the bug persists in mtbs builds with that commit, then i'll need the logs still.
Comment 7 Danish Akhtar 2015-07-10 06:33:39 UTC
We are also getting this issue after following the steps mentioned in bug with latest master builds.

Supplement info for the same:
mtbserver log: https://gist.github.com/NaqeebAnsari/fa5da5a68a7c51461ab5
error details: https://gist.github.com/Shruti360/b18a5643f22d690bae2a.
iOS designer logs: https://gist.github.com/Shruti360/f372f5f16e5365f4d835
ide logs: https://gist.github.com/Shruti360/301596cda812a366ddf0

Environment info:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02241
Microsoft LightSwitch for Visual Studio 2013

Microsoft Office Developer Tools for Visual Studio 2013 ENU   06177-004-0446016-02241
Microsoft Office Developer Tools for Visual Studio 2013 ENU

Team Explorer for Visual Studio 2013   06177-004-0446016-02241
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02241
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02241
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02241
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02241
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02241
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.

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

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.0
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 

Microsoft Web Developer Tools 2013   2.0.40926.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

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

Packet.VisualStudio   1.0
Manage your Paket dependenciesFile from Visual Studio!

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

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

Windows Azure Mobile Services Tools   1.0
Windows Azure Mobile Services 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   5.1.230.0 (14c5754)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.99.474 (0367eedf6502bf9f0c7306293524b60a9344896a)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.11.0.0 (26aba2496ae308fdfa810dc99da54250e00f00f5)
Visual Studio extension to enable development for Xamarin.iOS.

X.IOS 8.11.0.1205
Comment 8 Alan McGovern 2015-07-10 07:11:50 UTC
The commit is still not in VS builds. I'll mark this as 'needinfo' until updated builds have been provided to you guys to test with.

I've cc'ed the relevant people so hopefully we'll get updated builds shortly.
Comment 9 Daniel Cazzulino 2015-07-10 09:37:20 UTC
Bumped md-addins in ae869f1b6111ad29b82ca71d47a6bd5031cf1f82 in master.
Comment 10 Alan McGovern 2015-07-13 06:47:19 UTC
Removing needinfo because the builds were made.

Please retest with the newer builds
Comment 11 Alan McGovern 2015-07-15 05:27:59 UTC
Just closing this as fixed as there has been no update and we have landed patches which might fix it.
Comment 12 Danish Akhtar 2015-07-15 08:51:02 UTC
Today, I have checked this issue with latest master builds XVS 5.1.235 + X.iOS  8.11.0.1220, now this issue is not exists. We are successfully able to open a storyboard file in first attempt.

Hence closing this issue.

Environment details:
VS 2013
XVS 5.1.235
X.iOS 8.11.0.1120
Windows 8
Xcode 6.2
Comment 13 Alan McGovern 2015-08-25 16:22:21 UTC
*** Bug 32845 has been marked as a duplicate of this bug. ***