Crash On XP

Nov 16, 2008 at 11:45 AM
Edited Feb 14, 2009 at 4:34 AM
Hey,

I developed a simple app under vista and it works all happy, when I tried it on my XP machine it started crashing whenever I bring up a window with a DataGrid on it.

I get the following error:
Cannot create instance of 'DataGrid' defined in assembly 'WPFToolkit, Version=3.5.31016.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Exception has been thrown by the target of an invocation.  Error at object 'System.Windows.Controls.Grid' in markup file 'Project;component/views/testwindow.xaml' Line 7 Position 10.

With an Inner Exception of:

{"Method not found: 'System.Windows.Threading.DispatcherOperation System.Windows.Threading.Dispatcher.BeginInvoke(System.Delegate, System.Windows.Threading.DispatcherPriority, System.Object[])'."}

I am running VS 2008 with .NET 3.5 sp1, below is the test code.

<Window x:Class="Project.Views.TestWindow"
    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="" Height="300" Width="300" ShowInTaskbar="False" ResizeMode="CanResizeWithGrip">
    <Grid>  
        <dg:DataGrid ItemsSource="{Binding}">
            <dg:DataGrid.Columns>
                <dg:DataGridTextColumn Header="A" Width="SizeToCells"  
                                           Binding="{Binding A}"
                                           IsReadOnly="True"/>
                <dg:DataGridTextColumn Header="B"
                                           Binding="{Binding B}" />
            </dg:DataGrid.Columns>
        </dg:DataGrid>
    </Grid>
</Window>

    public partial class TestWindow : Window
    {
        class Test
        {
            public string A { get; set; }
            public string B { get; set; }
        }
        ///<summary>
        /// Constructor
        ///</summary>
        public TestWindow()
        {
            InitializeComponent();

            DataContext = new List<Test>
                              {
                                  new Test {A = "df", B = "fdss"},
                                  new Test {A = "df2", B = "fdss2"}
                              };
        }
    }

Cheers