System.Windows.Interactivity: Failed to load file or assembly 'System.Windows, Version = 2.0.5.0

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

But as soon as I add a link to this assembly, I get an error loading System.Windows 2.0. This is apparently a known bug, and the solution seems to be to simply reference this assembly.

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

however, now I get a lot of conflicts between System.Windows and WindowsBase.dll. Classes such as RoutedEventHandler exist in both cases. There should be a way to fix this, as I can see that people are successfully using this interactivity DLL with wpf 4.0 ..

+7
source share
4 answers

If you have a WPF project, you need to use a specific version of WPF for this assembly, maybe you took the wrong DLL?

Here are two relevant 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 
+13
source

You need to reference the dll in the main project (and not just the management libraries). This was a problem in my case. See here for more details: Failed to load file or assembly "System.Windows.Interactivity"

+2
source

If one of your projects targets a .NET 4.0 client profile, you may find that switching to a full .NET 4.0 environment fixes the problem.

+1
source

Sonic, like HB said you can't use the version of Silverlight in WPF. You will need to install WPF-specific Expression Blend instead of WPF .

0
source

All Articles