Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
582 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 SDKsExpressionBlend.NETFrameworkv4.0LibrariesSystem.Windows.Interactivity.dll
C:Program Files (x86)Microsoft SDKsExpressionBlendSilverlightv4.0LibrariesSystem.Windows.Interactivity.dll

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...