System.IO.FileNotFoundException Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified System.Windows.Markup.XamlParseException was unhandled Message='The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '5' and line position '9'. Source=PresentationFramework LineNumber=5 LinePosition=9 StackTrace: at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit" Title="Hydraulic Calculations, 2011" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" Icon="/WpfApplication1;component/Images/2.ico" WindowStyle="SingleBorderWindow" Loaded="Window_Loaded" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="534" d:DesignWidth="780" SizeToContent="WidthAndHeight"> <Window.TaskbarItemInfo> <TaskbarItemInfo /> </Window.TaskbarItemInfo> <Grid Height="497"> <chartingToolkit:Chart Grid.Column="6" Grid.ColumnSpan="7" Grid.Row="14" Grid.RowSpan="7" Height="126" HorizontalAlignment="Left" Margin="53,3,0,0" Name="chart1" VerticalAlignment="Top" Width="316" BorderBrush="DarkMagenta"> <chartingToolkit:PieSeries ItemsSource="{Binding}" IndependentValueBinding="{Binding Path=Name}" DependentValueBinding="{Binding Path=Votes}"> </chartingToolkit:PieSeries> </chartingToolkit:Chart> </Grid> <Window.Background> <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"> <GradientStop Color="Black" Offset="0" /> <GradientStop Color="#FF2C83CB" Offset="1" /> </LinearGradientBrush> </Window.Background> </Window>
'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '10' and line position '9'
public partial class Window1 : System.Windows.Window { public Window1() { try { InitializeComponent(); } catch ( Exception ex ) { // Log error (including InnerExceptions!) // Handle exception } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)