开发者

ConfigurationSection with multiple projects

开发者 https://www.devze.com 2023-01-01 06:56 出处:网络
In my asp.net solution i have a couple of class library-projects that act as modules of the site. In main project I have SiteConfigurationSection class that derives from ConfigurationSection.

In my asp.net solution i have a couple of class library-projects that act as modules of the site.

In main project I have SiteConfigurationSection class that derives from ConfigurationSection.

I want all projects to be able to access an开发者_如何学JAVAd use this SiteConfigurationSection.

But class library projects can't access it because they obviously don't have a reference to the website itself.

Should create a special library-project for SiteConfigurationSection of maybe it's better to create a mini SiteConfigurationSection class in every project and encapsulate only the needed values?


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号