系统:win10
VS版本:2017
.NET Core 版本: 1.1
零.读取配置文件
参考:http://www.tuicool.com/articles/QfYVBvi
- 此版本无需添加其他组件
- 在
appsettings.json
配置中添加节点AppSettings
- 添加配置文件的映射模型
- 在Startup.cs ConfigureServices方法中注册
services.AddOptions();
services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));