c# - Environmental variables ignored for Layout in Area -


i have problem in asp.net core mvc application.

can advise why tag helper environment (names) isn't working (administration) layout page when located inside area?

when referencing scripts using below code, works when placed standard _layout.cshtml page not _layout.cshtml contained within area (used administration area). ideally trying modularise code areas - dashboard contains _layout.cshtml page administration area.

i discovered css/js references being included (unminified , minified , cdn). put below code public layout , admin layout.

<environment names="development">   development </environment> <environment names="staging,production">   staging production </environment> 

~/views/shared/_layout.cshtml (public)

"development" displayed (good)

~/areas/dashboard/views/shared/_layout.cshtml (administration)

"development staging production" displayed (bad)

my environmental variable is aspnetcore_environment (with value of development)

my start up

public startup(ihostingenvironment env) {     var builder = new configurationbuilder()         .setbasepath(env.contentrootpath)         .addjsonfile("appsettings.json", optional: true, reloadonchange: true)         .addjsonfile($"appsettings.{env.environmentname}.json", optional: true)         .addenvironmentvariables();      if (env.isdevelopment())     {         // more details on using user secret store see http://go.microsoft.com/fwlink/?linkid=532709         builder.addusersecrets();     }      configuration = builder.build(); } 

configure method ...

app.usemvc(routes => {     routes.maproute(name: "arearoute",                     template: "{area:exists}/{controller=home}/{action=index}");      routes.maproute(name: "default",                     template: "{controller=home}/{action=index}/{id?}"); }); 

any great - thank you. dan.

sounds taghelper not getting registered in area , being processed browser.

taghelpers environment have referenced in _viewimports.cshtml file, default in /views should exist in each of areas.


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -