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
The answer is here:
The @page Razor directive makes the file into an MVC action — which means that it can handle requests. @page must be the first Razor directive on a page.
Hence the solution is extremely simple, just reorder the directives:
@page
@using Microsoft.Extensions.Options
@inject IOptions Options
@model AboutModel
@{
ViewData["Title"] = "About";
}
<
@Model.Message
Options
Refresh time @Options.Value.SubOpt.RefreshTime