XML名称空间"http://xamarin.com/schemas/2014/forms"中的未知类型"ContentPage"

use*_*975 1 c# xml xaml mvvm xamarin

我正在MVVM中编写一个应用程序.我的MainPage.xaml看起来像这样:

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:view="using:FIARView"
                 xmlns:controls="using:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView"
                 x:Class="clr-namespace:FIARView.MainPage">
...
Run Code Online (Sandbox Code Playgroud)

我在这个xaml文件中使用的所有内容都有错误:例如:

Unknown type 'ContentPage' in XML namespace 'http://xamarin.com/schemas/2014/forms'
Unknown type 'Button' in XML namespace 'http://xamarin.com/schemas/2014/forms'
Run Code Online (Sandbox Code Playgroud)

等我尝试寻找答案但没有找到答案.我怎么解决这个问题?

Pop*_*yto 6

您可能在资源管理器中创建了一个带有复制粘贴的页面并包含在项目中,因此您错过了这些xaml属性:

  • 构建"嵌入式资源"的操作
  • 自定义工具"MSBuild:UpdateDesignTimeXaml":

构建操作和自定义工具