none
A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

    Question

  • Hi,

    I have a solution with several C# (WPF) projects created in Visual Studio 2010 under Windows XP SP3.

    When I launch my application get the following exception:

    A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
    A first chance exception of type 'System.IO.FileNotFoundException' occurred in PresentationFramework.dll
    A first chance exception of type 'System.Xaml.XamlObjectWriterException' occurred in System.Xaml.dll
    A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

    Additional information: 'Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '8' and line position '18'.

    The exception appears in my application xaml (App.xaml) when I add a resource dictionary located at a different project (CommonRes) of the same solution.

    <Application x:Class="S80.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 StartupUri="MainWindow.xaml">
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="pack://application:,,,/CommonRes;component/Dictionary1.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>
    </Application>

    If I remove the ResourceDictionary.Source the exception dissapears.

    Even if the Dictionary1.xaml is empty get the same exception.

    Dictionary1.xaml:

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
       
    </ResourceDictionary>

     

    any ideas?

    Thanks,

    Monday, January 03, 2011 8:13 AM

Answers

  • Hi,

     

    I resolved the error creating my main project again, and then adding the classes. That is, the same code but with a new project ???.

    I suppose something of the project was corrupted. My solution is under file-level version control (Visual Source Safe), so Visual Sourcesafe may be the responsible.

     

    Thanks,

     

    Wednesday, January 05, 2011 8:30 AM

All replies