I am setting up my xml configuration files for my asp.net web application using spring.net-dependent IOC injection. I referenced each of my configuration files in the web.config file. Sample settings in spring.net configuration file (settings.xml):
<object id="obj1" type="NS.Common.Cache.Class, NS.Common" singleton="true" init-method="Initialize" destroy-method="Dispose"> <property name="Name" value="My Name" /> </object>
It all works great.
Now I install my web application in several environments, so I am creating a spring.net configuration file for the environment, for example. dev, qa, prod.
Thus, when installing the application, the corresponding spring environment file is referenced in the web.config file. This is part of an automatic installer.
Inside the qa environment file, I want to override the object above "obj1":
<object id="obj1" type="NS.Common.Cache.Class2, NS.Common" singleton="true" init-method="Initialize" destroy-method="Dispose"> <property name="Name" value="My New Name" /> </object>
However, since it is automated (adding a link to the environment file), the settings.xml file does not change.
And now referring to 2 files with a specific object with the same identifier - this causes serious problems, because runtime errors will occur.
Is there a way that I can include in qa.xml a flag or the like to highlight this object definition overriding any other specific objects in any other XML file with the same object identifier?
amateur
source share