In Project-Explorer click on the xml file and set (under properties)
Buildaction="Embedded ressource".
So the file will be embedded in the assembly.
The call at runtime is i.e. :
Assembly thisExe = Assembly.GetExecutingAssembly();
Stream file=
thisExe.GetManifestResourceStream("myAssemblyName.myXmlFile.xml");
textBoxXML.AppendText(new StreamReader(file).ReadToEnd());
file.Close();
In some cases the StreamReader.Read should be with Encoding.Default.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.