1

Topic: asp net core 2.0 with localization

Good afternoon misters! I pick net core 2. Rested against not clear problem: assembly name: salut a project name: server the controler: \Controllers\CustomersController.cs a resource file: \Resources\Controllers. CustomersController.ru.resx a line in a file: Header ConfigureServices from startup: public void ConfigureServices (IServiceCollection services) {string connstr = Configuration. GetConnectionString ("MainDb"); services. AddLocalization (options => options. ResourcesPath = "Resources"); services.AddDbContext<dataclasses.datacontext> (options => options. UseNpgsql (connstr)); services. AddMvc ();} the controler code in which I try to receive the localized value: public class CustomersController: Controller {private readonly DataContext _context; private readonly IStringLocalizer <customerscontroller> _localizer; public CustomersController (IStringLocalizer <customerscontroller> localizer, DataContext context) {_context = context; _localizer = localizer;} //GET: Customers public async Task <iactionresult> Index () {string Header = _localizer ["Header"]; return View (await _context. Customer. ToListAsync ());}} string Header = _localizer ["Header"]; does not find value of a resource. In debugging looks here so: _localizer ["Header"] {Name = "Header" ResourceNotFound = true SearchedLocation = "Server.Recources.Controllers.CustomersController" Value = "Header"} how to call a resource file that it was? ((Renamed / moved in \Server\Resources\Controllers. CustomersController.ru.resx not  in \Server.Resources.Controllers.CustomersController.ru.resx, \Server\Resources\Controllers\CustomersController.ru.resx - to it  . A trick in that that in the project with  a name and  an assembly title \Resources\Controllers. CustomersController.ru.resx is it is equal until then yet  the project

2

Re: asp net core 2.0 with localization

Localization for some reason ceases to work at project saving on any way to a distinct from way by default. At saving in C:\Users \{User} \source\repos all wonderfully starts to work. Probably any jamb Core 2