locked
Cannot find type 'System.Windows.Interactivity.EventTrigger' rte using WPF and VS2008 RRS feed

  • Question

  • I am creating a WPF application using VS 2008 with the Expression Blend 3 SDK.

    I am using the following references at the top of my usercontrol:

    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:il="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Microsoft.Expression.Interactions"

    my Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll versions are both 1.0.1340.0

    I have created the following code which compiles without any problems (this is in a datatemplate for what it's worth):

    <ComboBox Name="ProfileOptionsComboBox" Grid.Row="0" Grid.Column="1" SelectedIndex="1" ItemsSource="{Binding Path=ProfileTypesView}">
      <i:Interaction.Triggers>
       <i:EventTrigger EventName="SelectionChanged">
         <i:InvokeCommandAction
           CommandName="{Binding SelectProfileTypeViewCommand, Source={StaticResource ViewModel}}"
           CommandParameter="{Binding SelectedItem, ElementName=ProfileOptionsComboBox, Mode=OneWay}" />
       </i:EventTrigger>
      </i:Interaction.Triggers>
    </ComboBox>

     Unfortunately, when I actually run the code I get the following run time error:

    Cannot find type 'System.Windows.Interactivity.EventTrigger'. The assembly used when compiling might be different than that used when loading and the type is missing.  Error at object 'System.Windows.DataTemplate' in markup file 'ProtocolProfiler.Modules.Setup;component/views/setupview.xaml' Line 67 Position 26.

    i:EventTrigger comes up happily on a intellisense. How can it be using a different assembly upon loading? I only have one assembly version!

    This has been driving me crazy for two days.

    Any help would be appreciated.

    Thanks,

    Leon

     

    Thursday, May 20, 2010 1:01 PM

Answers

  • I spent the whole day trying to recreate this in a project by itself, but did not manage it.

    I seem to have got rid of the problem by adding a new usercontrol and copying the code from the old usercontrol to the new one, then renaming the old one.

    When I went back to the old usercontrol to try force the problem again it had then gone away, so perhaps just renaming the class would have worked?

    Strange little problem that has cost me three days. :(

    The code no longer crashes there, but at the next line (it's one brick wall after the next) which I will write up as a new problem

    Thanks,

    Leon

    • Marked as answer by Iobetes Friday, May 21, 2010 1:03 PM
    Friday, May 21, 2010 1:02 PM

All replies

  • Is it possible to share out a small repro so we can investigate?

    Otherwise you will have to debug and find this out - run the program from VS, and the see what modules (assemblies) are getting loaded into the AppDomain and where they are coming from.

    THanks,
    Unni


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, May 20, 2010 6:49 PM
  • I spent the whole day trying to recreate this in a project by itself, but did not manage it.

    I seem to have got rid of the problem by adding a new usercontrol and copying the code from the old usercontrol to the new one, then renaming the old one.

    When I went back to the old usercontrol to try force the problem again it had then gone away, so perhaps just renaming the class would have worked?

    Strange little problem that has cost me three days. :(

    The code no longer crashes there, but at the next line (it's one brick wall after the next) which I will write up as a new problem

    Thanks,

    Leon

    • Marked as answer by Iobetes Friday, May 21, 2010 1:03 PM
    Friday, May 21, 2010 1:02 PM