Created a solution, there are two projects: the first is the presentation (UI), the second is the data access layer (DAL). In DAL created a configuration file.
I make a call from the UI of some methods located in the DAL and using the configuration file via ConfigurationManager.AppSettings
. And ... nothing happens, nulls are returned. Suspicions have crept in that the configuration file is searched, as it were, in the current context (that is, in my case, in the UI project). I copied the configuration file to the UI project and it all worked.
The question arises, how to be? How to force ConfigurationManager
to search for a configuration file in the context of the project in the project of which its direct call is located? Or maybe some other approach should be used?
AppSettings
in a UI project? Isn't that obviously a model thing? Something is wrong with your architecture. - VladD