Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Windows.Interactivity: Could not load file or assembly 'System.Windows, Version=2.0.5.0

I am trying to reference System.Windows.Interactivity in order to support IsExpanded behavior command

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.

I downloaded Silverlight SDK, and referenced assembly in question in my project.

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..

like image 400
Sonic Soul Avatar asked Sep 25 '11 21:09

Sonic Soul


2 Answers

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 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
like image 157
H.B. Avatar answered Sep 30 '22 12:09

H.B.


You need to reference the dll's in the main project (not just the control libraries). It was the problem in my case. See more info here: Could not load file or assembly 'System.Windows.Interactivity'

like image 43
Eternal21 Avatar answered Sep 30 '22 13:09

Eternal21