xamarin.forms - 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 感到很失望,看起来非常有问题,而且很难上手。这是我到目前为止所尝试的:
- 构建项目
- 重建项目
- 清洁项目
- 从构建中取消选择所有项目(我有一个主项目 + Android 和 Windows 项目),应用更改,清理,构建,重新选择所有项目以不同顺序构建多次。
- 删除 bin 和 obj 文件夹
- 多次重新打开VS
- 删除 .vs 文件夹,包括 .suo 文件
- 删除抛出错误的代码行
- 检查构建顺序
VS 还给了我 4 个可能与该问题有关的其他错误:
- 错误 CS0006 找不到元数据文件“C:\Users...\bin\Debug\netstandard2.0\DojoBoss.dll”
- “ResolveLibraryProjectImports”任务意外失败。
- 无法解析程序集或 Windows 元数据文件 'C:\Users...\bin\Debug\netstandard2.0\DojoBoss.dll'
- 当前上下文中不存在名称“InitializeComponent”
解决方案
我不知道这是什么“cxmlns”。我们可以改变这条线吗
cxmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
至
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
推荐阅读
- r - 将虚拟变量转化为权重
- testing - 尝试在模拟器中使用 appium 代码启动 Firefox 时,Firefox 崩溃
- python - Python,Tkinter:使用 tkcalendar 计算剩余天数
- javascript - 如何将pdf中的文本翻译成js中所需的语言
- r - 是否有一个 R 函数来预处理整个 CSV 文件以进行情绪分析?
- html - 修复了对视口变化的封面背景口吃响应
- kotlin - Kotlin Kafka 消费者
- c# - 从可以从多个线程读取/写入而不会崩溃的意义上,静态变量是线程安全的吗?
- python - 如何用照片制作电报机器人回复?
- azure - 灾难恢复 Azure 资源组区域停机 发生了什么