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
1.4k views
in Technique[技术] by (71.8m points)

wpf - Referencing the correct System.Windows.Interactivity dll from Prism application

I have a WPF Prism application that I'm building. The application is to the point where I want to be able to add EventTriggers to controls so I can call commands on the underlying view model. However, I can't seem to reference the correct DLLs to make the project run. Currently, I'm referencing Microsoft.Expression.Interactions and System.Windows.Interactivity from the C:Program Files (x86)Microsoft SDKsExpressionBlend.NETFrameworkv4.0Libraries directory.

When I run the module, I get this error:

Could not load file or assembly 'System.Windows.Interactivity,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.

I checked the System.Windows.Interactivity assembly in reflector and can see that it references:

  • mscorlib
  • PresentationCore
  • PresentationFramework
  • System
  • System.Core
  • System.Xaml
  • WindowsBase

All the references point to the 4.0 framework. I've referenced each from the .NET reference tab, making sure that each one is the 4.0 version. All these references are being loaded from the C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.0 directory.

Is there another download I need for the System.Windows.Interactivity and Microsoft.Expression.Interactions assemblies to work in my environment?

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

For some reason that I still cannot fathom, Prism includes it's own version of the Blend SDK assemblies. So you should reference Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll from the LibDesktop folder of the Prism distribution (assuming you're using Prism v4) rather than from the Blend SDK installation.


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

...