Hi,
I created a clean Core 2.0 with Authentication, but when I inject the IOptions at Razor page (Account/login), the error occurs. Nuget already reference "Microsoft.Extensions.Options (2.0.1)" when I created the project.
ErrorOne or more compilation references are missing. Ensure that your project is referencing 'Microsoft.NET.Sdk.Web' and the 'PreserveCompilationContext' property is not set to false.
The type or namespace name 'IOptions<>' could not be found (are you missing a using directive or an assembly reference?)
public IOptions<AppSettings> Settings { get; private set; }
View@model LoginViewModel
@inject IOptions<AppSettings> Settings
<div>login elements here...</div>
AppSettings.cspublic class AppSettings {
public static readonly string DemoPassword = "Password";
}
Thanks