我有一个奇怪的问题,添加一个dll参考。我有一个WPF应用程序,我试图使用WPF MDI库:http://wpfmdi.codeplex.com/添加DLL参考
正如在说明中规定(这是很模糊),我右键点击在VS2012的引用,点击Add reference..
,点击Browse..
并添加了我下载的dll。
接下来,我在窗口的XAML中添加了以下行:xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"
,如说明中所述。
但是,尝试添加一个<mdi:MdiContainer>
时,会显示以下错误消息:
The type 'mdi:MdiContainer' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
The name "MdiContainer" does not exist in the namespace "clr-namespace:WPF.MDI;assembly=WPF.MDI".
任何想法?
编辑:
加我的XAML文件项目的
<Window x:Name="..." x:Class="MyClass.MyClass"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mdi="clr-namespace:WPF.MDI;assembly=WPF.MDI"
Title="" WindowState="Maximized">
<Window.Resources>
<Style TargetType="TreeView">
<Setter Property="Padding" Value="0,0,20,0"/>
<Setter Property="BorderBrush" Value="Gray"/>
<Setter Property="BorderThickness" Value="0,0,5,0"/>
</Style>
</Window.Resources>
<mdi:MdiContainer></mdi:MdiContainer>
</Window>
您是否设置了复制本地的引用?很确定你需要为命名空间来解决。 – iivel
检查DLL引用,复制到本地应该是true。在添加XAML文件中的任何参考之前,尝试构建一次项目。 – jags
是的,它设置为true –