我试图在我的解决方案中使用WPF的Dynamic Data Display库。我在项目中添加了对DynamicDataDisplay.dll
的引用。我还在.xaml文件中添加了一个命名空间,像这样:xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
当我尝试从Dynamic Data Display库中添加元素时,智能感知功能没有帮助我。当我在我的.xaml文件中输入以下内容时:
<d3:ChartPlotter></d3:ChartPlotter>
Visual Studio 会用一些文本将其标记为错误,例如:
The type 'd3:ChartPlotter' was not found. Verify that you are not missing an
assembly reference and that all referenced assemblies have been built.
但奇怪的是它仍然可以编译。 请问有人能告诉我哪里出了问题吗?
下面是一段示例代码,它可以成功编译,但在设计器中却显示错误:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
Title="MainWindow" Height="350" Width="525">
<Grid>
<d3:ChartPlotter></d3:ChartPlotter>
</Grid>
编辑:
我尝试了像 Merlyn Morgan-Graham 建议的命名空间声明,但还是不起作用。另一个错误出现了:
Unable to load the metadata for assembly 'DynamicDataDisplay'.
This assembly may have been downloaded from the web.
See http://go.microsoft.com/fwlink/?LinkId=179545. The following error was encountered
during load: etc.
似乎需要手动取消阻止已下载的程序集。这可以在Windows文件属性中完成。解除阻止并重新启动Visual Studio后,问题得到解决。
(来源:www.xup.in)