ConfigurationSection with multiple projects

In my asp.net solution, I have several class project classes that act as site modules.
In the main project, I have a SiteConfigurationSection class that comes from ConfigurationSection.

I want all projects to be able to access and use this SiteConfigurationSection.
But class library projects cannot access it, because they obviously do not have a link to the site itself.

Should you create a special library project for SiteConfigurationSection, maybe it's better to create a Mini SiteConfigurationSection class in each project and encapsulate only the values ​​you need?

+3
source share
1 answer

Creating a common assembly for things like generic configuration types, generic interfaces, domain objects, etc. is an appropriate action.

Just create a separate class library and specify it in each project that needs to read the configuration.

+3
source

Source: https://habr.com/ru/post/1747199/


All Articles