Bug 40084 - [Cycle SR3] Visual Studio hangs when user attempts to close the "Tools > Xamarin Account > Log In" dialog after a successful activation if Android "Packaging" project properties are open
Summary: [Cycle SR3] Visual Studio hangs when user attempts to close the "Tools > Xama...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.0.0 (C6)
Hardware: PC Windows
: --- minor
Target Milestone: 4.0.3 (C6SR3)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-04-04 19:47 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-04-06 16:42 UTC (History)
3 users (show)

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


Attachments
Call stack of the hung VS main thread (13.09 KB, text/plain)
2016-04-04 19:47 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:
RESOLVED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2016-04-04 19:47:15 UTC
Created attachment 15598 [details]
Call stack of the hung VS main thread

[Cycle SR3] Visual Studio hangs when user attempts to close the "Tools > Xamarin Account > Log In" dialog after a successful activation if Android "Packaging" project properties are open




## Regression status: "regression" in Cycle 6 – Service Release 3

BAD:  Xamarin 4.0.3.214 (0dd817c)
GOOD: Xamarin 4.0.1.147 (1cc3a99)


I put "regression" in quotes because I suspect this might be a bug in the new feature that automatically changes the visibility of the "AOT Compatibility" and "Using LLVM Optimizing Compiler" checkboxes depending on the current license level. From that perspective the bug could be considered purely a "new feature bug" rather than a regression.




## Steps to replicate

1. Open Visual Studio (I tested with both 2013 Update 5 and 2015 Update 1).

2. Log out of your Xamarin account.

3. Close and reopen Visual Studio.

4. Create a new "Visual C# > Android > Blank App (Android)" project. 

5. Open "Project Properties > Android Options > Packaging [tab]". (This step is _required_, and the particular "Packaging" tab is also _required_.)

6. Log in to an old-style Xamarin Business account via "Tools > Xamarin Account".

7. After activation completes, click the "Close" button on the dialog.




## BAD Results (with Xamarin 4.0.3.214)

Visual Studio's GUI thread becomes non-responsive ("gets stuck", "freezes", "hangs", "pauses") for 1 minute or longer. (In some of my trials it didn't close even after 5 minutes, so I killed the VS instance.)


### Top of the call stack of the main thread (https://kb.xamarin.com/customer/en/portal/articles/2232835)

> [Managed to Native Transition]	
> PresentationFramework.dll!System.Windows.Window.DoDialogHide()	Unknown
> PresentationFramework.dll!System.Windows.Window.CloseWindowFromWmClose()	Unknown
> PresentationFramework.dll!System.Windows.Window.WmClose()	Unknown
> PresentationFramework.dll!System.Windows.Window.WindowFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)	Unknown
> PresentationCore.dll!System.Windows.Interop.HwndSource.PublicHooksFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)	Unknown
> WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)	Unknown
> WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o)	Unknown
> WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)	Unknown
> WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)	Unknown
> WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)	Unknown
> WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)	Unknown
> [Native to Managed Transition]	
> [Managed to Native Transition]	
> PresentationFramework.dll!System.Windows.Window.InternalClose(bool shutdown, bool ignoreCancel)	Unknown
> PresentationFramework.dll!System.Windows.Window.Close()	Unknown
> Xwt.WPF.dll!Xwt.WPFBackend.DialogBackend.EndLoop()	Unknown
> Xwt.dll!Xwt.Dialog.Respond(Xwt.Command cmd)	Unknown
> Xamarin.Components.Ide.dll!Xamarin.Components.Ide.Activation.ActivationDialog.DisplayWorkflowStep(Xamarin.Components.Ide.Activation.ActivationWorkflowStep step)	Unknown
> Xamarin.Components.Ide.dll!Xamarin.Components.Ide.Activation.ActivationDialog.HandleWorkflowAction(Xamarin.Components.Ide.Activation.ActivationWorkflowAction action)	Unknown
> Xamarin.Components.Ide.dll!Xamarin.Components.Ide.Activation.ActivationDialog.FooterButton.OnClicked(System.EventArgs e)	Unknown
> Xwt.dll!Xwt.Button.WidgetBackendHost.OnClicked()	Unknown
> Xwt.dll!Xwt.Toolkit.Invoke(System.Action a)	Unknown
> Xwt.dll!Xwt.Backends.ApplicationContext.InvokeUserCode(System.Action a)	Unknown
> Xwt.WPF.dll!Xwt.WPFBackend.ButtonBackend.HandleWidgetClicked(object sender, System.EventArgs e)	Unknown




## GOOD Results (with Xamarin 4.0.1.147 (1cc3a99)

The dialog closes immediately after the user clicks "Close".




## Additional version info (brief)

Windows 10 (64-bit) (US/English locale)
Comment 2 xamarin-release-manager 2016-04-06 16:41:39 UTC
Fixed in version 99.0.0.2023 (master)

Author: jmt
Commit: b1e9a1ff4f3f0d39d32ddef6fe614b0ecf4d786a (xamarin/XamarinVS)
Comment 3 xamarin-release-manager 2016-04-06 16:42:12 UTC
Fixed in version 4.1.0.291 (cycle7)

Author: jmt
Commit: 1407488a31200d08acf920192901e1c77a5e321c (xamarin/XamarinVS)