Bug 46654 - VS2015 hangs after Cycle 9 update
Summary: VS2015 hangs after Cycle 9 update
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: High blocker
Target Milestone: 4.3.0 (C9)
Assignee: Bugzilla
URL:
: 46707 ()
Depends on:
Blocks:
 
Reported: 2016-11-09 17:55 UTC by adrianknight89
Modified: 2017-03-06 13:32 UTC (History)
6 users (show)

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


Attachments
logs (37.35 KB, application/zip)
2016-11-09 22:52 UTC, adrianknight89
Details
Patched Android targets (5.64 KB, application/zip)
2016-11-10 16:16 UTC, Jose Gallardo
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 adrianknight89 2016-11-09 17:55:09 UTC
# Steps to reproduce
When I installed Cycle 9 alpha on both Mac and Windows, VS stopped working. I'm trying to load the Xamarin.Forms solution on GitHub, but VS hangs. This happens with or without an iPhone device connected to the Mac host. At the moment, I'm downloading XCode 8.1 (had 8 already) to see if this fixes anything.

# Expected behavior
VS2015 should not hang in Cycle 9 when Xamarin.Forms.sln is being opened (save VS shortcut to taskbar, right click on the icon, and click the sln entry in the context menu)

# Test environment (full version information)
Windows 10 Enterprise (Build 14393)
Visual Studio 2015 with Update 3
Resharper 9
Cycle 9 alpha
Comment 1 Ben Beckley 2016-11-09 19:40:08 UTC
Thank you for using the alpha channel and reporting this issue. Your feedback is appreciated. There have been a few issues filed for Xamarin.Forms with the Cycle 9 alpha build. It sounds like you may be hitting bug 46611. Could you please attach the Xamarin logs?
Comment 2 adrianknight89 2016-11-09 22:52:27 UTC
Created attachment 18400 [details]
logs

Not sure if the logs are useful.

Please note that I'm not trying to create a new Forms app. Instead I'm trying to load up Xamarin.Forms.sln here: https://github.com/xamarin/Xamarin.Forms

When VS is trying to load each project, I can see a linear progress bar at the top of Solution Explorer, but it hangs about 70% in.
Comment 3 adrianknight89 2016-11-09 23:07:20 UTC
set back to new for further investigation
Comment 4 Jose Gallardo 2016-11-10 13:15:36 UTC
Hi Adrian,

First of all, thanks for trying our early preview build. Your feedback is very valuable, and it definitely helps us to improve our product.

You're correct, It's not the same bug. It looks like a different issue making VS to get hang while loading certain projects (presumably projects with several resource files).

We found the root cause in that case being a change in the Xamarin.Android targets, ending up performing some blocking tasks during the intellisense VS build.

As a workaround, and hoping you're hitting this issue, can you please edit the file:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.Debugging.targets

And replace the line containing:

<Target Name="_GetPrimaryCpuAbi">

with:

<Target Name="_GetPrimaryCpuAbi" DependsOn="_SetupDesignTimeBuildForIntellisense" >

The try to restart Visual Studio and open your solution.

Please let me know if that works for you.

We're looking forward to include this fix soon.

Thanks!
Comment 5 adrianknight89 2016-11-10 14:34:59 UTC
Hi Jose,

Thanks for the suggestion. I tried your fix and restarted VS. VS stopped hanging (which is great), but some of my projects stopped loading. VS now thinks Xamarin is not properly installed.

For example, I cannot load Xamarin.Forms.ControlGallery.Android (unavailable). You have to right click and see "Install Missing Feature(s)". Same with PagesGallery.Droid. These used to work before I switched to Cycle 9.
Comment 6 Jose Gallardo 2016-11-10 14:40:44 UTC
Hi Adrian,

Do you see the same if you right click and select "Reload Project"?
Comment 7 xamarin-release-manager 2016-11-10 15:40:14 UTC
Fixed in version 4.3.0.254 (cycle9)

Author: josegallardo
Commit: 86a313d746b3fd13fc5f1702e657d4379d988821 (xamarin/XamarinVS)
Comment 8 Jose Gallardo 2016-11-10 16:16:12 UTC
Created attachment 18415 [details]
Patched Android targets

@Adrian,

If the project appears as unavailable, that might mean that the targets file is broken.

In case that's the issue I've put together what should actually be the fix for this issue.
I'm including the original Xamarin.Android.Common.Debugging.targets in case you lost it.

Please place the two files included in the zip in your MSBuild/Xamarin/Android folder.

As some projects have been marked as incompatible already, you might need to reload them manually by right-clicking the project and selecting Reload project.

Thanks
Comment 9 Jose Gallardo 2016-11-10 17:06:59 UTC
*** Bug 46707 has been marked as a duplicate of this bug. ***
Comment 10 adrianknight89 2016-11-10 18:54:28 UTC
I was able to proceed by using those files and reloading. Thanks for the quick fix.
Comment 11 Ben Beckley 2016-11-10 20:42:53 UTC
Verified that I am not experiencing any hang when opening the Xamarin.Forms sln with 4.3.0.254 (cycle9/1065737)

env info: https://gist.github.com/BenBeckley/10db944da136f586a4478188e2a4e6cd
Comment 12 github 2017-03-05 15:32:12 UTC
I've just upgraded to Xamarin 4.3.0.784. VS2015 now totally hangs when opening a xamarin project (I've tried 2).

Xamarin.Android.Common.Debugging.targets has the following in it

<Target Name="_GetPrimaryCpuAbi" DependsOn="_SetupDesignTimeBuildForIntellisense" >

Any suggestions as I can't develop at the moment
Comment 13 github 2017-03-06 13:32:07 UTC
Sorted! I created a new Xamarin portable project. This opened fine. I could then open my previous solutions (phew)