Bug 15795 - Exception on reconnection
Summary: Exception on reconnection
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 0.x Insider Preview
Hardware: PC Windows
: Highest blocker
Target Milestone: ---
Assignee: Dominique Louis
URL:
Depends on:
Blocks:
 
Reported: 2013-10-29 14:38 UTC by Miguel de Icaza [MSFT]
Modified: 2014-03-27 09:13 UTC (History)
6 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 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 Miguel de Icaza [MSFT] 2013-10-29 14:38:53 UTC
When I start Visual Studio, it does not seem to know how to automatically connect.

Any reason why every time I start visual Studio I have to reconnect?
Comment 1 Miguel de Icaza [MSFT] 2013-10-29 15:07:24 UTC
Take a look at this, this is what happens when I restart Visual Studio, this is likely what does not realize I was connected, and what prevents the "Connect" to work.

Even worse, if I hit "Diagnose" it crashes VS:

Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Error establishing connection to Xamarin.iOS build server
System.TypeInitializationException: The type initializer for 'Mono.VisualStudio.Extension.UIThread' threw an exception. ---> System.InvalidOperationException: The current SynchronizationContext may not be used as a TaskScheduler.
   at System.Threading.Tasks.SynchronizationContextTaskScheduler..ctor()
   at System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()
   at Mono.VisualStudio.Extension.UIThread..cctor()
   --- End of inner exception stack trace ---
   at Mono.VisualStudio.Extension.UIThread.get_Default()
   at Mono.IOS.VisualStudio.Utilities.Helpers.EstablishConnection(VSBuildServerClient srv, String connectMessage, Int32 maxRetries, Boolean autoShowWizard)
Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Force-closing the server connection
Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 : Exception caught.
System.TypeInitializationException: The type initializer for 'Mono.VisualStudio.Extension.UIThread' threw an exception. ---> System.InvalidOperationException: The current SynchronizationContext may not be used as a TaskScheduler.
   at System.Threading.Tasks.SynchronizationContextTaskScheduler..ctor()
   at System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext()
   at Mono.VisualStudio.Extension.UIThread..cctor()
   --- End of inner exception stack trace ---
   at Mono.VisualStudio.Extension.UIThread.get_Default()
   at Mono.IOS.VisualStudio.Utilities.Helpers.EstablishConnection(VSBuildServerClient srv, String connectMessage, Int32 maxRetries, Boolean autoShowWizard)
   at Mono.IOS.VisualStudio.Utilities.Helpers.<TryEstablishConnection>b__bf(VSBuildServerClient srv)
   at Mono.IOS.VisualStudio.Utilities.Helpers.DoRunLockedServerCode[TResult](Boolean writeLock, Boolean justTry, Func`2 code, Action tryEnterFailure)
Mono.IOS.VisualStudio.MonoTouchPackage Error: 0 :    at Mono.VisualStudio.Extension.UIThread.get_Default()
   at Mono.IOS.VisualStudio.Utilities.Helpers.EstablishConnection(VSBuildServerClient srv, String connectMessage, Int32 maxRetries, Boolean autoShowWizard)
   at Mono.IOS.VisualStudio.Utilities.Helpers.<TryEstablishConnection>b__bf(VSBuildServerClient srv)
   at Mono.IOS.VisualStudio.Utilities.Helpers.DoRunLockedServerCode[TResult](Boolean writeLock, Boolean justTry, Func`2 code, Action tryEnterFailure)
Mono.IOS.VisualStudio.BuildServerAddressProvider.BuildServerAddressProvider Error: 0 : Server address 255.255.255.255 is not routable
Comment 2 Alan McGovern 2013-10-31 14:34:12 UTC
QA has confirmed the second fix did the trick. Therefore closing this bug.
Comment 3 narayanp 2014-03-27 09:13:54 UTC
I have checked it with following builds:

Master Xamarin.VisualStudio_Setup-1.99.396
and Xamarin for VS 1.12.247
X.iOS 7.2.1-63

If VS is connected to build host and user reopen VS or reopen or create new iOS application, VS get connected automatically.