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.
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))
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.
Created attachment 24459 [details]
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.
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.
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).
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!
(Note: I tested using the latest master builds)
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 :)
Specifically this line is returning false - https://github.com/xamarin/designer/blob/master/Xamarin.Designer.VisualStudio/src/VisualStudio.Designer/VsDesignerCommand.cs#L26
Fixed in version 184.108.40.2069 (master)
Author: Adrian Alonso
Commit: 9f88e5c5744fc75353ee45f99b986141167a586a (xamarin/XamarinVS)
*** Bug 59989 has been marked as a duplicate of this bug. ***