Updating the launchSettings.json file

Last but not least, we need to set up our app so that it will run in Production mode whenever we publish it.

To do that, open the /properties/launchSettings.json file and change the ASPNETCORE_ENVIRONMENT variable within our application's profile from Development to Production in the following way:

[...]

"TestMakerFree": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
},
"applicationUrl": "http://localhost:27240/"
}

[...]

This will ensure that the appsettings.Development.json file won't be loaded whenever our web app will be deployed into production.

It's worth noting that the preceding update will also allow the appsettings.Production.json to be loaded instead, if only there were one; it can be used to overwrite some default values in production mode. However, in our specific scenario, we didn't need to add it, as the appsettings.json file already has everything we need.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.157.6