GetmainfestStream in WPF to load xml file RRS feed

  • Question

  • I have a WPF application in which I am doing the following thing to load a XML file, and further to parse it.

    I have set the Build Action to Embedded Resource, Copy to Output Directory.<br/>
    The code that I am using is:

                        Xmlfile = XDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream("file.xml"));
                    catch(Exception ex)

    Message that I receive as an exception:<br/>
    Value cannot be null.
    Parameter name: input

    Thursday, April 5, 2012 8:46 AM