I have a class library at the moment and it's going to need its own appsettings and it's likely going to need to change them and stuff.
The only problem is that the class is going to be called by a web application which has an appsettings file that also has identical keys to the class library app settings.
I would like to ensure that the class library uses it's own appsettings file and also that it doesn't make changes to the web application's appsettings.
Is this possible? It seems like any assembly can change the appsettings via ConfigurationManager.
EDIT - To give context, the class library accesses a data tier assembly (which I can't change) which uses a value in the appSettings to get the connection string. Only problem is that key is the same as the web app's connection string (which may or may not have a different value).
I don't want the class library to change the appSetting value for that key, and then have the web app start accessing a different database.
A separate app domain can use a different config file, I believe. I'm not sure how else you could do it.
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