I have an xml file say samplexml.xml and I have stored it in a folder called SampleFolder. Here how the Hierarchy is:
Solution->Project->SampleFolder->samplexml.xml. Suppose I am in a class called TestClass.cs that is in the project, How can I read all the contents of the xml file in a string.
Let’s say,
[TestClass]
public class TestClass
{
[TestMethod]
public void TestMethod()
{
//TODO: Read all the contents of the xml file in a string.
}
}
How do I do this??
Try:
Remember you should set compiler to copy xml file to destination dir