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

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.

主站蜘蛛池模板: 乌拉特前旗| 扎兰屯市| 红安县| 平塘县| 定襄县| 洛浦县| 尚志市| 福贡县| 曲麻莱县| 巩留县| 兴隆县| 新乡县| 溧水县| 锡林郭勒盟| 武鸣县| 黄山市| 太仆寺旗| 琼结县| 上栗县| 灵台县| 涟水县| 宝丰县| 营山县| 兴仁县| 黄龙县| 集安市| 仁布县| 凯里市| 赫章县| 焦作市| 五大连池市| 沾益县| 嘉义县| 伊吾县| 成都市| 临高县| 法库县| 昌邑市| 通化市| 赞皇县| 宁南县|