【问题标题】:WPF xmlns: The 'clr-namespace' URI refers to a namespace that is not included in the assemblyWPF xmlns:“clr-namespace”URI 指的是程序集中未包含的命名空间
【发布时间】:2011-10-31 02:28:57
【问题描述】:

我正在学习 xaml 中的数据绑定,而这个 xmlns 问题阻止了我。我的 cs 代码在命名空间“Ping”中。这是我的 MainWindow.xaml:

<Window x:Class="Ping.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:custom="clr-namespace:WPFDemo;assembly=WPFDemo"
    xmlns:local="clr-namespace:Ping"

最后一行像标题一样抱怨。为什么它不起作用?我正在使用“Ping”,这是我得到的唯一命名空间。

谢谢

【问题讨论】:

标签: wpf namespaces undefined xml-namespaces


【解决方案1】:

如果 Ping 是您使用的唯一命名空间,则应删除对 WPFDemo 的引用

【讨论】:

  • WPFDemo 是我引用的另一个项目(需要在该项目中使用自定义控件。)它们是否冲突?
  • 感谢您的澄清 - 毕竟您使用的是多个命名空间。我建议您发布更多代码;到目前为止您发布的 XAML 没有任何问题。查看使用本地命名空间的 XAML 以及您正在使用的 Ping 内部类的声明会很有帮助。
猜你喜欢
  • 2011-03-26
  • 2014-10-19
  • 1970-01-01
  • 2013-02-09
  • 1970-01-01
  • 2013-06-17
  • 2017-08-19
  • 1970-01-01
  • 2016-01-17
相关资源
最近更新 更多