Warm tip: This article is reproduced from serverfault.com, please click

c#-System.Windows.Interactivity: 无法加载文件或程序集“System.Windows, Version=2.0.5.0

(c# - System.Windows.Interactivity: Could not load file or assembly 'System.Windows, Version=2.0.5.0)

发布于 2011-09-25 21:35:08

我正在尝试引用 System.Windows.Interactivity 以支持 IsExpanded 行为命令

但是,一旦我添加对此程序集的引用,我就会收到加载 System.Windows 2.0 的错误。这似乎是一个已知错误,解决方案似乎只是引用该程序集。

我下载了 Silverlight SDK,并在我的项目中引用了有问题的程序集。

但是,现在我在 System.Windows 和 WindowsBase.dll 之间遇到了很多冲突。诸如 RoutedEventHandler 之类的类都存在于两者中。必须是解决此问题的一种方法,因为我看到人们成功地将 Interactivity dll 与 wpf 4.0 一起使用。

Questioner
Sonic Soul
Viewed
0
H.B. 2011-09-26 06:05:16

如果你有一个 WPF 项目,你需要使用该程序集的 WPF 特定版本,也许你使用了错误的 .dll?

这是我系统上的两个相应文件路径:

C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\System.Windows.Interactivity.dll
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries\System.Windows.Interactivity.dll