Enviroment specific appsettings.json

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
один год назад
Based on the documentation, it should be possible to use different appsettings based on the EnviromentName

https://docs.nopcommerce.com/en/developer/tutorials/appsettings-json-file.html

...the application configuration settings can be stored in different configurations sources such as appsettings.json file, appsettings.{EnvironmentName}.json file (where the {Environment} is the application's current hosting environments such as Development, Staging or Production)...


but looking at the code (program.cs)


builder.Configuration.AddJsonFile(NopConfigurationDefaults.AppSettingsFilePath, true, true);


public static partial class NopConfigurationDefaults
    {
        /// <summary>
        /// Gets the path to file that contains app settings
        /// </summary>
        public static string AppSettingsFilePath => "App_Data/appsettings.json";
    }


it seems this is not supported.

Is this correct or I'm missing something?

Thanks
один год назад
The public facing appsettings.json file is stored in the AppData folder of the www root default. Not sure if your referring to the public published website and storing other settings separately to other locations? I am sure that if your working local and in a development environment you can setup your on settings location.
You have the source so if you so elected to customize it, why would it not be allowed.
один год назад
Thanks for pointing this out. We've fixed that, details here.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.