Method not found: 'Void System.Windows.Media.Animation.Storyboard.SetTarget(System.Windows.DependencyObject, System.Windows.DependencyObject)'.

Nov 14, 2008 at 11:26 AM
Hi
What is wrong with thi code:

<Window x:Class="WizualizacjaWentylatora.Kal"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WpfToolkit"
    Title="Kalendarz" Height="300" Width="300">
    <Grid>
        <dg:Calendar x:Name="name"/>
    </Grid>
</Window>

I get an error:
    Method not found: 'Void System.Windows.Media.Animation.Storyboard.SetTarget(System.Windows.DependencyObject, System.Windows.DependencyObject)'.
Coordinator
Dec 3, 2008 at 11:48 PM
I can't seem to repro this error.  Do you get this at compile-time or at runtime?
Dec 4, 2008 at 6:57 AM
Edited Dec 4, 2008 at 7:04 AM
I get this error right after a add references to: WPFToolkit, WPFToolkit.Design and WPFToolkit.VisualStudio.Design to the project with code how above. This is an error in XAML Designer in Visual Studio at design time. At compile-time a get an error about InitializeComponent method. This is a some info about designer error:

<CUT>
Method not found: 'Void System.Windows.Media.Animation.Storyboard.SetTarget(System.Windows.DependencyObject, System.Windows.DependencyObject)'.
   at System.Windows.VisualStateManager.GenerateDynamicTransitionAnimations(FrameworkElement root, VisualStateGroup group, VisualState newState, VisualTransition transition)
   at System.Windows.VisualStateManager.GoToStateInternal(Control control, FrameworkElement element, VisualStateGroup group, VisualState state, Boolean useTransitions)
   at System.Windows.VisualStateManager.GoToState(Control control, String stateName, Boolean useTransitions)
   at Microsoft.Windows.Controls.VisualStates.GoToState(Control control, Boolean useTransitions, String[] stateNames)
   at Microsoft.Windows.Controls.Primitives.CalendarDayButton.ChangeVisualState(Boolean useTransitions)
   at Microsoft.Windows.Controls.Primitives.CalendarDayButton.OnApplyTemplate()
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
......
<CUT>
Please help.
Coordinator
Dec 4, 2008 at 9:15 PM
Ok I'm able to get the compile-time error about the InitializeComponent method now.  Could you please go through your entire VS solution and make sure that all namings and namespaces are consistent.  According to the code you pasted above, your project name should be "WizualizacjaWentylatora", this name should be reflected in the App.xaml, App.cs, Kal.xaml, Kal.cs, etc.  You're getting this InitializeComponent method error because the first line in your XAML, "x:Class='WizualizacjaWentylatora.Kal'" is looking for a Kal class in the WizualizacjaWentylatora namespace.

So let's try to isolate this problem, try commenting out any code you've written in the Kal.cs class, then ensure the naming is consistant throughout your VS solution and lets compile again.  Let me know how this works out and we can go from there.

Hope that helps,
Saied
Dec 10, 2008 at 10:59 AM
I still get an error, but now at run-time: Method not found: 'Void System.Windows.Media.Animation.Storyboard.SetTarget(System.Windows.DependencyObject, System.Windows.DependencyObject)'. When a comment

    <Grid>
        <!--<dg:Calendar x:Name="name"/>-->
    </Grid>

it works perfect. Any suggestions?
Coordinator
Dec 12, 2008 at 10:56 PM
I'm going to dig deeper into this.  For now you can try this, create a new WPF project in Visual Studio and add the WPFToolKit references.  Then paste in only the snippet you posted in the beginning of this discussion and make sure than you've renamed the "x:Class" attribute accordingly.  If you run this project and still get the "Method not found" error, it is most likely that you have not yet installed the .NET Framework 3.5 SP1.  What is the latest version of the .NET Framework installed on your machine?
Dec 23, 2009 at 5:51 PM
Edited Dec 23, 2009 at 5:51 PM

I had the same issue, pl. re-install .Net 3.5 SP1 and you should see no issues