How to allow an exception: cannot create an instance of "WindowsPage"

Brand new to Xamarin forms here and trying to get started with cross-platform applications using the package. However, right out of the gate, I seem to encounter a problem that was asked several times elsewhere, but in fact I did not see a real answer. I am currently trying to work with the UWP / Universal Windows / Windows 10 user interface in portable form / PCL settings.

Cannot instantiate WindowsPage error message in Microsoft Visual Studio 2015 Xaml Designer. I follow the guide at https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/ , so I added a line for "xmlns: forms =" using: Xamarin.Forms.Platform .UWP "xaml file before changing the page tag from page to forms: WindowsPage, thus referring to the xamarin forms package. I updated all NuGet packages to the latest version. Xamarin formats are something like 2.2 at the moment.

I initially set the default values ​​for the Xamarin VS2015 package, and I just tried to change this setting with every additional component, so I don't think there is anything missing. I believe that Xamarin is installed correctly, as it appears in the Help → Xamarin menu, and I can select new solutions from the Xamarin forms package, but I'm not sure what might cause the problem.

Here is the XAML code

<forms:WindowsPage
    x:Class="SoloPathfinderPCL.UWP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:forms="using:Xamarin.Forms.Platform.UWP"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SoloPathfinderPCL.UWP"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

</forms:WindowsPage>

Here's my stack trace for an exception: cannot create an instance of "WindowsPage".

at Microsoft.VisualStudio.DesignTools.Platform.InstanceBuilders.InstanceBuilderOperations.InstantiateType(Type type, Boolean supportInternal)
   at Microsoft.VisualStudio.DesignTools.Platform.InstanceBuilders.ClrObjectInstanceBuilder.InstantiateTargetType(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.VisualStudio.DesignTools.Platform.InstanceBuilders.ClrObjectInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.VisualStudio.DesignTools.WindowsXamlDesigner.InstanceBuilders.FrameworkElementInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.VisualStudio.DesignTools.WindowsXamlDesigner.InstanceBuilders.UserControlInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.VisualStudio.DesignTools.Platform.InstanceBuilders.ViewNodeManager.CreateInstance(IInstanceBuilder builder, ViewNode viewNode)

Hopefully someone can point me and everyone else having this problem in the right direction. Thank.

+4
source share
1 answer

, Xamarin, Xamarin Forms, Visual Studio Form Designer, - : ": Xamarin.Forms XAML". , :

public partial class MainPage : ContentPage

public partial class MainPage : Page

. , , WPF, Xamarin Forms. ContentPage - WPF Xamarin Forms. : , - "Toolbox", WPF. - .Net Controls, Windows, , , Xamarin Forms , Windows.

+1

All Articles