Bug 59059 - CommandBus does not support the `RebuildProject` action
Summary: CommandBus does not support the `RebuildProject` action
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: General ()
Version: 4.7.0 (15.4)
Hardware: PC Windows
: High blocker
Target Milestone: 15.4
Assignee: Bugzilla
: 59989 ()
Depends on:
Reported: 2017-08-25 23:37 UTC by Bret Johnson [MSFT]
Modified: 2017-10-05 15:35 UTC (History)
9 users (show)

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

Logs (4.29 KB, application/x-zip-compressed)
2017-08-29 17:01 UTC, Bret Johnson [MSFT]

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 Bret Johnson [MSFT] 2017-08-25 23:37:35 UTC
Create a Forms project and bring up the previewer, for Android (I didn't try iOS).

Do whatever it takes to get the "The Android project needs to be rebuilt before preview can be created." error message to show up, with the Rebuild Project and Reload Document action links.

I'm not sure what triggers that message to appear, as it seems to not show up when I expect it to, but that's a separate issue. When I saw it appear last, the project was partially built but the build had errors.

Click on the Rebuild Project and Reload Document links in the message.

Result: Nothing seems to happen. There's no evidence any kind of build is triggered (nothing in Output window changes, etc). Whenever this message showed up for me, that's the behavior I see.

Expected: The action links should work.
Comment 1 Prashant [MSFT] 2017-08-28 06:25:51 UTC
Thanks so much for taking the time to submit this report! I’m unable to reproduce this issue using the latest Visual Studio 2017 Preview version 15.4. Please attach the following to help us reproduce this issue: 
-Detailed reproduction steps 
-Version information (Help → About Microsoft Visual Studio → Copy Info) 
-Logs (Help → Xamarin → Zip Logs (last 7 days))
Comment 2 Bret Johnson [MSFT] 2017-08-29 16:16:39 UTC
I'm on 15.4 preview 1.
Prashant - When you say you are unable to repro, I assume you couldn't actually get it into the state where the Rebuild Project / Reload Document dialog shows up?
Also, FYI, I'm a MS/Xamarin employee.
Comment 3 Bret Johnson [MSFT] 2017-08-29 17:01:51 UTC
Created attachment 24459 [details]
Comment 4 Bret Johnson [MSFT] 2017-08-29 17:09:18 UTC
I attached logs. But they don't seems to show anything when the commands are selected.

To repro, do this:
- File / New Project Xamarin Forms project (I used Master/Detail PCL)
- Double click on some of the XAML files. At first you may see another error message (separate bug, #59054), but the error with the Rebuild / Reload UI should come up after.
Comment 5 Alan McGovern 2017-08-30 09:58:53 UTC
When you click `rebuild` do some new lines appear in the log containing this:

` ERROR: : The project was not built. HasSourceAssemblies False. HasLoadableAssemblies False`

That means we attempted to reload after compilation completed and the binaries were still missing.

If that line doesn't appear then either compilation failed or something else went wrong. If compilation failed you won't be able to launch the app either.
Comment 6 Bret Johnson [MSFT] 2017-09-01 00:18:27 UTC
I checked the Xamarin log files again & nothing gets logged there when clicking build / reload. Nor does anything appear in the VS Build Output window. It seems like the links just are a no-op currently (on VS Windows).
Comment 7 Bret Johnson [MSFT] 2017-09-01 00:19:40 UTC
updating status
Comment 8 Alan McGovern 2017-09-01 10:48:15 UTC
VSDesignerCommand.CanExecute returns false for these commands. This is a bug on the XVS side as we are calling the APIs correctly, but XVS itself is claiming the actions are unsupported. Reassigning it there!
Comment 9 Alan McGovern 2017-09-01 10:50:01 UTC
(Note: I tested using the latest master builds)
Comment 10 Alan McGovern 2017-09-01 10:51:53 UTC
This code looks the same in master and 15-4 and this issue definitely meets the bar for backporting according to me. It's possible others will disagree, but we should prioritise this appropriately for a d15-4 inclusion until we hear otherwise! I'm hoping it's a simple fix :)
Comment 13 xamarin-release-manager 2017-09-04 14:21:00 UTC
Fixed in version (master)

Author: Adrian Alonso
Commit: 9f88e5c5744fc75353ee45f99b986141167a586a (xamarin/XamarinVS)
Comment 15 Alan McGovern 2017-10-05 15:35:06 UTC
*** Bug 59989 has been marked as a duplicate of this bug. ***