官术网_书友最值得收藏!

Getting started

Previous versions of .NET had a relatively simple configuration system, where all settings went into Extensible Markup Language (XML) files with the .config extension. There was a basic schema that could handle both system settings and untyped key-value pairs, but they were all strings. There was also some degree of inheritance, as some of the settings could be defined machine-wide and then overridden per application, and even in virtual applications underneath an Internet Information Services (IIS) application. It was possible to define custom sections with typed settings and complex structures by writing and registering .NET classes.

However, as convenient as this would seem, it turns out it had its limitations—namely, the following:

  • Only XML files were supported; it was not possible to have other configuration sources out of the box.
  • It was difficult to have different configuration files/configuration sections per environment (staging, quality assurance (QA), production, and more).
  • It was not possible to receive notifications when the configuration changed.
  • It was tricky to save changes.

Moreover, as dependency injection was not part of the core .NET infrastructure, there was no way to have configuration values injected into its services automatically. Let's see how .NET Core 3 helps us overcome these limitations.

主站蜘蛛池模板: 泾阳县| 盘锦市| 通河县| 甘肃省| 东至县| 喜德县| 鄯善县| 公主岭市| 三台县| 葵青区| 巴彦县| 库尔勒市| 上饶县| 英山县| 洪江市| 明光市| 乌海市| 洛川县| 普安县| 清远市| 宜春市| 扎兰屯市| 江川县| 沙湾县| 石景山区| 湘潭县| 镶黄旗| 衢州市| 尉氏县| 滦平县| 察雅县| 视频| 双鸭山市| 阿荣旗| 保靖县| 隆德县| 祥云县| 邮箱| 绿春县| 明光市| 尉犁县|