I want to store configuration information about my DLL in an XML file inside my DLL i.e. if changes need to be made the DLL must be re-compiled.
The reason is because its a elegant format and I may not use config files for this DLL.
Any ideas? I literally want to be able to edit an xml in Visual Studio then compile it and only see a DLL in the output.
Yup - include it as an Embedded Resource (i.e. use that setting in the Properties for the item in Visual Studio), then use Assembly.GetManifestResourceStream
to read it.
I do this all the time for unit test data. As you say, you can just edit the file, rebuild, and it'll be there.
I wanted to make a small addendum to Jon's answer. Embedded Resource is the value of the Build Action property on the Properties panel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With