“http://schemas.microsoft.com/winfx/2009/xaml”命名空间中不存在属性“类”
Posted
技术标签:
【中文标题】“http://schemas.microsoft.com/winfx/2009/xaml”命名空间中不存在属性“类”【英文标题】:The property "Class" does not exist in the "http://schemas.microsoft.com/winfx/2009/xaml" namespace 【发布时间】:2017-07-13 17:48:42 【问题描述】:我正在使用 Xamarin.Forms 构建应用程序,并在创建 XAML 页面时收到以下错误:
属性“类”不存在于 “http://schemas.microsoft.com/winfx/2009/xaml”命名空间。
这不是我制作的第一页,除此之外,所有其他页面似乎都可以正常工作。我检查了该文件的引用和属性,它们看起来都很好。
这是我的代码:
<?xml version="1.0" encoding="utf-8" ?>
<controls:ViewPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XXXX"
xmlns:controls="XXXX"
</controls:ViewPage>
后面的代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XXXX;
using Xamarin.Forms;
namespace XXXX
public partial class ActOverviewView : ViewPage, IActOverviewView
public ActOverviewView()
InitializeComponent();
我正在使用 Visual Studio 2015
【问题讨论】:
您是否从ViewPage
继承了您的behind class
?也为这个页面添加你的后台代码。
好的,我添加了。我与 3 位不同的专业程序员(不包括我自己)一起查看了它,其中一位建议可能是 Xamarin 不能很好地处理 UWP,这可能是造成这种情况的原因吗?
我不这么认为,你也说过,所有其他页面都可以正常工作。也许,xmlns:controls
命名空间是错误的
其他页面不是 UWP,而是 droid 和 ios,所以我们认为这可能是问题所在。我已经多次检查了所有命名空间等,所以我不认为就是这样。我现在刚刚跳过了 UWP,如果我有足够的时间,我可能会在以后拿起它,除非这里有人提供解决方案:)。
确保 xaml 文件是嵌入式资源并且生成器设置为“MSBuild:UpdateDesignTimeXaml”
【参考方案1】:
应该是:
<?xml version="1.0" encoding="utf-8" ?>
<controls:ViewPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XXXX.ActOverviewView"
xmlns:controls="XXXX"
</controls:ViewPage>
【讨论】:
@RichardHammond 似乎是对 Xamarin 的准确描述以上是关于“http://schemas.microsoft.com/winfx/2009/xaml”命名空间中不存在属性“类”的主要内容,如果未能解决你的问题,请参考以下文章
“http://schemas.microsoft.com/winfx/2009/xaml”命名空间中不存在属性“类”
找不到与命名空间 http://schemas.microsoft.com/WebParts/v3/Publishing/runtime 关联的脚本或扩展对象
[Java - 调用WebService]{http://schemas.microsoft.com/ws/2005/05/addressing/none}ActionNotSupported(代码片
在哪里可以找到 XAML 命名空间 d="http://schemas.microsoft.com/expression/blend/2008" 映射库?
Azure ServiceBus的消息中带有@strin3http//schemas.microsoft.com/2003/10/Serialization/?