Created a resource file .resx, then added to it an existing .xml file. Now it is not clear how to read this .xml file from the resource file .resx.

PS When reading the same .xml file from the file system, there were no problems.

    1 answer 1

    Did you create a resource in a standard way, through project properties?

    ResX Editor

    Then the resource can be accessed simply by name (I have TestXml ):

     var content = Properties.Resources.TestXml; var doc = XDocument.Parse(content); Console.WriteLine(doc); 

    The program issues:

     <root> <test /> </root> 
    • Everything works, thank you. - Corax
    • @Corax: Please! - VladD