Bug 53143 - Wrong assembly path, namespace and variable in MasterDetailPage template
Summary: Wrong assembly path, namespace and variable in MasterDetailPage template
Status: RESOLVED DUPLICATE of bug 53020
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Templates ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: 15.2
Assignee: Pierce Boggan [MSFT]
Depends on:
Reported: 2017-03-08 03:45 UTC by Frankie Foo
Modified: 2017-04-06 18:42 UTC (History)
5 users (show)

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

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 Frankie Foo 2017-03-08 03:45:45 UTC
### Scenario

- Add MasterDetailPage to folder in Portable project.
- 4 files generated( HostPage.xaml, HostPageDetail.xaml, HostPageMaster.xaml, HostPageMenuItems.xaml)
### Issues

- HostPage.xaml: Incorrect XML namespace by including the folder name as part of the assembly path: xmlns:pages="clr-namespace:MyApp.Pages; assembly=MyApp.Pages"

- The generated class def in *.xaml is x:Class="MyApp.Pages.HostPage", but it mismatched with the code-behind *.xaml.cs, which the namespace is defaulted to "MyApp.Pages.HostPage"

- HostPageMaster.xaml.cs: a ViewModel is included but with a mismatched variable (MenuItems vs HostPageMenuItems)

class HostPageMasterViewModel : INotifyPropertyChanged
    public ObservableCollection<HostPageMenuItem> MenuItems { get; }
    public HostPageMasterViewModel()
        HostPageMenuItems = new ObservableCollection<HostPageMenuItem>(new[]

Cross posted in https://forums.xamarin.com/discussion/90256/wrong-project-problematic-pages-template-issue-in-vs2017

### Steps

- Create X-Plat App > BlankApp + Forms + PCL
- Add new folders (Pages) to portable 
- Add 'Forms MasterDetailPage XAML' to the 'Pages' folder

### Version

VS 2017 Enterprise 15.0.0-RTW+26228.4
Comment 1 Pierce Boggan [MSFT] 2017-04-06 18:40:56 UTC
Thanks so much for the report, Frankie! :) We have fixed this bug in Visual Studio 15.2, and it should be included in the next preview of Visual Studio (and eventually 15.2 stable).

For instructions on installing preview builds, visit:

*** This bug has been marked as a duplicate of bug 53020 ***