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 assem开发者_开发技巧bly 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..
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
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'
I got this error when running a project built in a previous version of Visual Studio, but I was running it in VS2017.
My issue was resolved by opening the VS2017 installer and modifying my install to select the "Blend for Visual Studio SDK for .Net" component in the VS 2017 install.
Fissh
If one of your projects is targeting the .NET 4.0 Client Profile you might find switching to the full .NET 4.0 framework corrects the issue.
Sonic, like H.B. said you can't use Silverlight version in WPF. You will need to install different WPF specific Expression Blend SDK instead of Silverlight.
精彩评论