Is it possible to configure ms Unity container from an xml document and NOT from a file? thx
views:
586answers:
3
A:
Not sure about that, but you can configure programmatically without a .config, so you could have your own xml file, read settings and programmatically setup your Unity container. It's ashame this facet isn't covered in alot of the documentation. There are alot of scenarios where the App.config isn't available or appropriate.
Edit:
By default, this is the App.config or Web.config file for your application. However, you can load configuration information from any other XML format file or from other sources.
AaronLS
2009-04-07 00:37:02
Thank you for the quick response. What they show is in code, or from another file. I want to manage the configuration in sql and read the data into an xmldocument and then populate the container.
2009-04-07 00:47:47
Oh sorry, I mistook "document" to mean file, didn't realize you meant a inmemory XmlDocument. Closest you might get is reading it from SQL and configuring in code, without the XmlDocument. Would be a pain though. I'm searching to see if there are any methods for inmemory config files in general.
AaronLS
2009-04-07 00:56:02
I wonder if you might be able to implement a ConfigurationManager class that allows for the use of an XmlDocument.
AaronLS
2009-04-07 01:02:40
A:
Hi,
Why don't you save the XMLDocument in some file localy on the machine and then load that XML file in the Unity container.
Unless there is any restriction in saving the XMLdocument i think it would work.
rauts
2009-09-25 09:08:34