首页 > 解决方案 > Xamarin 构建错误“cxmlns”是未声明的前缀

问题描述

我正在尝试构建我的 Xamarin.Forms 项目并遇到意外错误“'cxmlns' 是未声明的前缀。第 3 行,位置 14”。我试过在网上搜索解决方案,但没有罚款。我见过其他类似的问题,并且我尝试了对其他人有用的解决方案,但到目前为止,在我的情况下没有任何效果。这是我的 MainPage.xaml 代码:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         cxmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:local="clr-namespace:DojoBoss"
         x:Class="DojoBoss.MainPage"
         BackgroundImage="background1">

</ContentPage>

我发现我收到此错误很奇怪,因为这是 Visual Studio (VS) 的空白应用程序附带的所有股票代码,除了我放入背景图像的 1 行。今天早些时候这也工作正常,我没有做任何改变,但现在它不起作用。到目前为止,我对 VS 和 Xamarin 感到很失望,看起来非常有问题,而且很难上手。这是我到目前为止所尝试的:

VS 还给了我 4 个可能与该问题有关的其他错误:

标签: xamarin.formsvisual-studio-2017

解决方案


我不知道这是什么“cxmlns”。我们可以改变这条线吗

cxmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"

推荐阅读