I am programming in .NET (C#) using Visual Studio. I want to use am XML file to store some information in my program. No other programs will ever need to access this XML file and no one will need to access/modify it manually our without using the program. I am wondering what build options I should select for this file or if it really makes a difference? Should it be an embedded resource or content file, etc? If i could build it right in to the .exe I would but I don’t think that is possible. Also, if I have to do anything special to reference the file please comment on that.
Share
Add your file to the project as a resource. See this MSDN article for how to do this.
By using this method, the resource is added to your assembly and is exposed as a strongly-typed property of the
Resourcesclass (BaseNamespace.Properties.Resources). It is much easier to use than the old school GetManifestResourceStream version, plus you get compile time safety.