开发者

Deploy multiple configs or put everything in a single web config?

开发者 https://www.devze.com 2023-01-07 21:02 出处:网络
Our solution file contains many different projects including an ASP.NET MVC web app, a windows service, and several desktop applications.One project handles logging and has an app.config file containi

Our solution file contains many different projects including an ASP.NET MVC web app, a windows service, and several desktop applications. One project handles logging and has an app.config file containing a list of recipients to inform when something fatal has been logged.

Concerning the deployment of our webapp, I was wondering if it would be better to create a se开发者_如何学运维ction in the web.config containing this information so that I wouldn't have to deploy the logger's app.config, or is it better to do deploy separately, since other applications use the logger and it should depend on its own file to tell it who to inform?


Typically it's best to push the responsibility of infrastructure configuration up to the consuming client application (whether that be configuration through code, Web.config, app.config, etc.). That is to say, if the library is expecting certain sections to exist in the default config file, make providing this the responsibility of the client's config.


Do what makes the most sense to you and your team.

I've seen this done a dozen ways and it never changed how successful the application was and no customer/stakeholder/enduser ever cared.

0

精彩评论

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