i am having a classlibrary with app1.config and also a windows application with app2.config;i am adding the reference of classlibrary in windows application as well as app1.config.is it possible if i call the method class lib it will go to app1.config otherwise it will use app2.config;
i am having a classlibrary with app1.config and also a windows application with app2.config;i
Share
The best you can achieve is to have two separate configuration files, then have the code of one method read the “main” config file (using the ordinary
ConfigurationManager.AppSetting[""]code) and other method read the configuration file of the class library using such code:This will read application setting from the config file of DLL sitting in the location of
dllFilePath.You can also have separate section for the class library in the “main” configuration file if relevant I can give sample as well.