Forms Previewer - Parameterless Constructor error

AdamLonsdale.3550AdamLonsdale.3550 GBUniversity ✭✭

Hello,

I've just created a new Xamarin.Forms ContentPage XAML and when using the forms previewer it doesn't load. I get the error "This control does not have a default parameterless constructor. It cannot be previewed unless it contains one."

Interestingly, I have a parameterless constructor as I have only just created the page.

I'm using the latest Xamarin Studio from the Stable Channel 6.2.1829. Do you have any idea what will resolve this? I mean I can build it, but this is a screen that takes quite a while to get to in the App so I would prefer to just preview it whilst I design it.

Thanks

Posts

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai

    @AdamLonsdale.3550

    I tried to reproduce that issue but could not. I started with a new template Forms solution, built it, and then added a new ContentPage and even added the same code as shown in your screenshot. Once I built the project again, I could preview the UI in Forms Previewer. Before building I did get a message that "The base class associated with this Xaml file could not be found. Please double check the class referenced in the 'Class' attribute exists, and that the project has been compiled," but as noted after compiling the preview worked.

    What version of Xamarin Forms are you using in your project? In mine it was the latest stable Forms version 2.3.3.193.

  • AdamLonsdale.3550AdamLonsdale.3550 GBUniversity ✭✭

    Hmm good point, I'm on 2.3.3.180 - I'll try and get that upgraded to the latest version after reading through the changelogs.

    Thanks

  • SagarPanwalaSagarPanwala USMember ✭✭

    I'm facing problems with both Android and iOS previewer.
    I rebuild all the projects many times and re run VS17.
    I have default ctor too in code behind with IntializeComponent
    so right now I'm clueless how to solve this bug.


  • batmacibatmaci DEMember ✭✭✭✭✭

    it occurs for me as well. it looks like none of the syncfusion tools work for xamarin previewer. it is such a dramatic decision to discontinue with live-reload

  • NMackayNMackay GBInsider, University mod

    @batmaci said:
    it occurs for me as well. it looks like none of the syncfusion tools work for xamarin previewer. it is such a dramatic decision to discontinue with live-reload

    Yeah, the community asked to discontinue Livereload....oh no, hang on, they didn't.

  • NMackayNMackay GBInsider, University mod

    @batmaci said:
    it occurs for me as well. it looks like none of the syncfusion tools work for xamarin previewer. it is such a dramatic decision to discontinue with live-reload

    The previewer doesn't support 3rd party custom control providers btw.

Sign In or Register to comment.