问题描述
我试图引用 System.Windows.Interactivity 以便 支持 IsExpanded 行为命令
I am trying to reference System.Windows.Interactivity in order to support IsExpanded behavior command
但是一旦我添加了对这个程序集的引用,我就会收到加载 System.Windows 2.0 的错误.这似乎是一个已知错误,解决方案似乎只是引用该程序集.
But as soon as i add a reference to this assembly, i get the error loading System.Windows 2.0. This appears to be a known bug, and solution appears to be to just reference that assembly.
我下载了 Silverlight SDK,并在我的项目中引用了有问题的程序集.
I downloaded Silverlight SDK, and referenced assembly in question in my project.
但是,现在我在 System.Windows 和 WindowsBase.dll 之间遇到了很多冲突.RoutedEventHandler 之类的类都存在于两者中.. 必须是解决这个问题的一种方法,因为我看到人们成功地将 Interactivity dll 与 wpf 4.0 一起使用..
however, now i am getting lots of conflicts between System.Windows, and WindowsBase.dll. Classes such as RoutedEventHandler exist in both.. Must be a way to fix this, since i see people being successful in using that Interactivity dll with wpf 4.0..
推荐答案
如果你有一个 WPF 项目,你需要使用该程序集的 WPF 特定版本,也许你拿错了 .dll?
If you have a WPF project you need to use the WPF specific version of that assembly, maybe you took the wrong .dll?
这是我系统上的两个文件路径:
Here are the two respective file paths on my system:
C:Program Files (x86)Microsoft SDKsExpressionBlend.NETFrameworkv4.0LibrariesSystem.Windows.Interactivity.dll
C:Program Files (x86)Microsoft SDKsExpressionBlendSilverlightv4.0LibrariesSystem.Windows.Interactivity.dll
这篇关于System.Windows.Interactivity: 无法加载文件或程序集“System.Windows, Version=2.0.5.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!