Xamarin 构建错误 'cxmlns' 是未声明的前缀
Xamarin build error 'cxmlns' is an undeclared prefix
我正在尝试构建我的 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"
我正在尝试构建我的 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"