Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi, what's solution for this error?

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)
.---------------------------------------------------
XML
<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>
Posted
Updated 11-Jan-12 3:33am
v3

There is some sort of binding error in the XAML for your Main Window. Can you show you XAML code - add it to your original question using Improve Question button.
 
Share this answer
 
Comments
M.H. Shojaei 11-Jan-12 9:27am    
<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>

<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}">




<window.background>
<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
<gradientstop color="Black" offset="0">
<gradientstop color="#FF2C83CB" offset="1">
</LinearGradientBrush>

'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'
.
 
Share this answer
 
v2
public partial class Window1 : System.Windows.Window { public Window1() { try { InitializeComponent(); } catch ( Exception ex ) { // Log error (including InnerExceptions!) // Handle exception } } }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900