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

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


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

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]
Logs
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 4.8.0.339 (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. ***

Note You need to log in before you can comment on or make changes to this bug.