Following this guide, I\'m trying to show on an ASP.NET Core 2.0 page the settings values.
In startup.cs I added some services:
services.AddLocalizat
you still need to add the below code in your startup.cs file
services.AddLocalization(options => options.ResourcesPath = "Resources");
services.AddOptions();
services.Configure(Configuration);
also you need to set the default value of RefreshTime in appsettings.json and then use the below code in.cshtml page
@using Microsoft.Extensions.Options;
@using ;
@inject IOptions Options
@page
@model AboutModel
@{
ViewData["Title"] = "About";
}
<
@Model.Message
Options
Sub Options
Refresh time @Options.Value.SubOpt.RefreshTime
let me know if it works for you.