Publish and Run an ASP.NET Core 1.0 Application in Production -


on aspnetcore 1.0 application have following on startup:

public startup(ihostingenvironment hostingenvironment) {    configurationbuilder builder = new configurationbuilder();    builder     .setbasepath(hostingenvironment.contentrootpath)     .addjsonfile("settings.json", false, true)     .addjsonfile($"settings.{hostingenvironment.environmentname}.json", false, true);   builder.addenvironmentvariables();    configuration = builder.build();  } 

i have 2 settings files on project:

settings.json settings.production.json 

i published project using command line:

set aspnetcore_environment=production dotnet publish --configuration release 

the published files include settings.json not settings.production.json. , settings.json include properties in settings.production.json. shouldn't merged on publish?

in top of how make sure application runs on production mode when copy files server?

do need on web.config?

you need update project.json add settings.production.json file include section of publishoptions:

{   "publishoptions": {     "include": [       "wwwroot",       "views",       "areas/**/views",       "settings.json",       "settings.production.json",       "web.config"     ]   } } 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -