7

I have C#/WPF that has a persistent problem loading/resolving the System.Windows.Interactivity I am using Visual Studio 2010 as my editor and already installed Blend 4 + Blend 4 SDK,

......

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">

Why still return result Assembly was not found? Like my class library CustomBehaviorLibrary was missing?

Community
  • 1
  • 1
Hyde
  • 129
  • 1
  • 2
  • 13
  • Alright, stupid question but I got to ask, did you add a reference to System.Windows.Interactivity? And which version of VS? Does it work at runtime? – Alan Jan 29 '13 at 03:59
  • 2
    try this please ;) xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" – Kapitán Mlíko Jan 29 '13 at 11:20
  • @KizuHikaru You can also look [here](http://stackoverflow.com/questions/7548780/system-windows-interactivity-could-not-load-file-or-assembly-system-windows-v) if you didn't already... There are two different interactivity dlls you need the one specific for WPF – Kapitán Mlíko Jan 29 '13 at 11:42
  • If my answer doesn't help you please post the exact error you are getting – Alan Jan 29 '13 at 16:03
  • Thanks thats help me so much, i am totally newbie for WPF, just start learn WPF since yesterday. :P – Hyde Jan 30 '13 at 01:57

2 Answers2

10

If it worked at runtime but not design-time then I am blaming VS 2010 for being buggy. I've had VS 2010 not recognize the local namespace when imported into XAML, but when opened in VS 2012 it worked in the designer with no problems. Unfortunately, Visual Studio 2010's XAML/WPF support is far from perfect. Expression Blend or Visual Studio 2012 are better.

I did like ViktorLaCroix 's suggestion. I would try

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

Instead of importing it using clr-namespace and see if that helps you. That's how I am using it and it works fine. I'll also show you my reference details for the library.

System.Windows.Interactivity
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\System.Windows.Interactivity.dll
v4.0.30319
Alan
  • 7,875
  • 1
  • 28
  • 48
6

The easiest way might be to get it from NuGet:

To install System.Windows.Interactivity v4.0 for WPF, run the following command in the Package Manager Console

PM> Install-Package System.Windows.Interactivity.WPF

http://www.nuget.org/packages/System.Windows.Interactivity.WPF/

seabass2020
  • 1,093
  • 14
  • 12