Could not load file or assembly Microsoft.Expression.Interactions and GalaSoft.MvvmLight.Extras.WPF4

╄→гoц情女王★ 提交于 2019-12-12 12:07:18

问题


I am facing unknown problem while using Prism 4. We implement business solution in MVVM pattern. For that I have used

 1. Microsoft.Expression.Interactions

 2. System.Windows.Interactivity

 3. GalaSoft.MvvmLight.Extras.WPF4

for Interaction.Triggers, CallMethodAction and EventToCommand.

<SWI:Interaction.Triggers>
    <SWI:EventTrigger SourceObject="{Binding ElementName=txtName}" EventName="GotFocus">
        <MEI:CallMethodAction TargetObject="{Binding Path=DataContext,ElementName=txtName}" MethodName="txtName_GotFocus"></MEI:CallMethodAction>
    </SWI:EventTrigger>
    <SWI:EventTrigger SourceObject="{Binding ElementName=txtName}" EventName="KeyUp">
        <GMEWCMD:EventToCommand   Command="{Binding Path=DataContext.cmdtxtNameKeyUpEvent,ElementName=txtName}" PassEventArgsToCommand="True">
        </GMEWCMD:EventToCommand>
    </SWI:EventTrigger>
</SWI:Interaction.Triggers>

Everything is working fine but now we required to make whole system loosely couple we choose prism 4. We already achieved this but above code create following problem as below.

Could not load file or assembly 'Microsoft.Expression.Interactions, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

If I comment above code everything is working fine. I don't know what an issue. Does PRISM 4 not support above assemblies?

Please help us to get rid from this problem.

Thank you


回答1:


This commonly happens to me when I reference both Microsoft.Expression.Interactions and System.Windows.Interactivity in a view that belongs to a module, but I fail to also add those references to the project that acts as the shell.




回答2:


I had a similar problem with Prism in Visual Studio 2012. The XAML editor would fail with the same exception.

The solution was to install Microsoft Expression Blend SDK. The assembly should be part of SDK. Allegedly, it is necessary for binding between control events and commands in XAML and some code may require it.




回答3:


I had the same problem during a Prism 6.1 composite app using .NET 4.5.2, where i was referencing in one of the modules (class library) the Microsoft.Expression.Interactions & System.Windows.Interactivity. Eventually i had to reference the same dlls in the Desktop project (where bootstrapper and Shell belong)



来源:https://stackoverflow.com/questions/9032238/could-not-load-file-or-assembly-microsoft-expression-interactions-and-galasoft-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!