Bug 52753 - Visual Studio hangs when upgrading Xamarin and packages to latest version and clearing bin/obj files
Summary: Visual Studio hangs when upgrading Xamarin and packages to latest version and...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-02-24 16:33 UTC by smorsi27
Modified: 2017-05-05 22:59 UTC (History)
7 users (show)

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

Minidump from hanged instance (1.34 MB, application/octet-stream)
2017-03-16 01:51 UTC, Hrvoje
Minidump from hanged instance after build (1.25 MB, application/zip)
2017-03-16 02:51 UTC, Hrvoje

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 smorsi27 2017-02-24 16:33:59 UTC
I recently upgraded Xamarin to latest stable release and I upgraded my support libraries and Google Play Services to the latest version targeting framework 7.0. I also deleted my bin and obj files and rebuilt the solution. 

After doing so, Visual Studio is hanging when I try to load my solution. I see my solution and project in Solution Explorer but I can't click on anything inside Visual Studio 2015 because it is hung. 

I tried to delete .vs and .suo hidden files (which was the solution to the previous issue with VS and Xamarin) but that doesn't seem to work anymore.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2017-02-25 22:28:38 UTC
I will tentatively mark this as a duplicate of Bug 52695 based on the similarity of the reported symptoms.

## Next steps

1. If you get a chance, you can try the candidate fix in the patched build as linked in Bug 52695, Comment 31.

2. If that build does _not_ resolve the issue, please collect and attach back (on this bug, Bug 52753) a minidump from the frozen instance of Visual Studio by attaching to it from a second instance [1], and then saving the minidump _without_ heap [2] (so it'll be of a manageable size).

[1] See steps 1-5 on https://developer.xamarin.com/guides/cross-platform/getting_started/visual_studio_with_xamarin/troubleshooting/vs-callstack/

[2] After you have paused the debugger via "Debug > Break All", choose "Debug > Save Dump As" and use "Save as type > Minidump (*.dmp)".  See also "Create a dump file" on https://msdn.microsoft.com/en-us/library/d5zhxt22.aspx

Thanks in advance!

*** This bug has been marked as a duplicate of bug 52695 ***
Comment 2 smorsi27 2017-03-09 20:39:08 UTC
This issue still occurs. Can you reopen this ticket? 

Following the example in the duplicate bug with the patch does not help with this issue. 

Here's a copy of this stacktrace: http://pastebin.com/KNc1WnZc
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-09 21:47:39 UTC
If possible, please attach back the full minidump without heap (see note [2] in Comment 1).  I notice that the stack trace linked in Comment 2 doesn't include the word "Xamarin", so I have a suspicion that there is another thread where some Xamarin code _is_ running.

Thanks much!
Comment 5 Hrvoje 2017-03-16 01:51:23 UTC
Created attachment 20372 [details]
Minidump from hanged instance
Comment 6 Hrvoje 2017-03-16 02:29:47 UTC
I almost uninstalled C9, and than I thought: Did I deleted also BIN and OBJ folder of iOS project, and voila, after I deleted it, and reopening solution VS was not hanging any more, behaved somewhat as klutz, I mean, mouse was slowed down when I was going over project items, but after I turned setting:

Tools->Options->Project and Solutions->Maximum number of parallel projects builds

from 1 to 8, it started working as I expect.

To conclude:
The solution for me was to
1. Remove all bin and obj folders in all projects and
2. Set "Maximum number of parallel projects builds" to 8.
Comment 7 Hrvoje 2017-03-16 02:51:49 UTC
Created attachment 20373 [details]
Minidump from hanged instance after build

Silly me.
Just reported that everything works OK, and after I build project, it hangs again.
I attached new mini dump.
Comment 8 Hrvoje 2017-03-16 06:09:24 UTC
You should search the reason in this behaviour in Xamarin Nuget packages.

When I rolled back to C8, it works exactly as C9 with with same Xamarin Nuget packages, but after I rolled up Nuget packages to 24.2.1, both C8 and C9 are working properly.
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-17 17:55:20 UTC
## Bookkeeping note

I will leave this bug as NEEDINFO for now since there's a chance the minidump from the other user in Comment 5 might not match the minidump that the original reporter in Comment 0 will attach back.

## Note to the user in Comment 5

If you (@Hrvoje) like, you may open a new bug report as the reporter and paste over the information from Comment 5 - Comment 8.  The status of that new bug can then track precisely the status of the information you have submitted.

## Note to the Xamarin team

If (a) a candidate build for the issue from Comment 5 - Comment 8 can be provided at some point in the future and (b) the original reporter from Comment 0 never attaches back an additional minidump, then we can tentatively mark this bug as resolved based on a verification from the other user in Comment 5 - Comment 8.  Thanks!
Comment 10 Brendan Zagaeski (Xamarin Team, assistant) 2017-03-23 16:24:25 UTC
@Hrvoje, by chance I was working on a problem yesterday which appears to precisely match the symptoms from Comment 5 - Comment 8.

That issue can be resolved by updating the Xamarin.Build.Download NuGet package to 0.4.3-beta2 or higher.  I have filed the details about that issue in Bug 53817.

The minidump from Comment 7 matches the details of that bug (Bug 53817).  In particular, it shows that the main thread is busy in the `Aapt.Execute()` method.

@smorsi27, if you get a chance to (a) check if updating the Xamarin.Build.Download NuGet package resolves the issue and (b) if not, attach back a minidump, that would be perfect.  Thanks!
Comment 11 Hrvoje 2017-03-25 10:33:25 UTC

Thank you so much for Xamarin.Build.Download 0.4.3-beta2.
I can confirm that Visual Studio 2015 now works like with no freezing at all.
Comment 12 Brendan Zagaeski (Xamarin Team, assistant) 2017-05-05 22:59:58 UTC
## Status update

I will mark this bug as resolved for now for bookkeeping, with a hunch that the issue was also resolved for the reporter of the bug by using the newer Xamarin.Build.Download NuGet package.  But if the reporter of the bug would like to pick back up on the investigation at some future date, please follow-up with testing the NuGet package and collecting the minidump as mentioned in Comment 10, and then change the "Status" of this bug to "REOPENED".  Thanks!