Skip to content

Commit

Permalink
nopSolutions#5002 Move 'appsettings.json' file to the App_Data directory
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanovM committed Sep 13, 2020
1 parent 021437f commit 6ca958b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,10 @@ public static partial class NopConfigurationDefaults
public static CacheKey SettingsAllAsDictionaryCacheKey => new CacheKey("Nop.setting.all.dictionary.", NopEntityCacheDefaults<Setting>.Prefix);

#endregion

/// <summary>
/// Gets the path to file that contains app settings
/// </summary>
public static string AppSettingsFilePath => "App_Data/appsettings.json";
}
}
File renamed without changes.
21 changes: 9 additions & 12 deletions src/Presentation/Nop.Web/Program.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Nop.Services.Configuration;

namespace Nop.Web
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
Host.CreateDefaultBuilder(args)
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.UseStartup<Startup>();
});
.ConfigureWebHostDefaults(webBuilder => webBuilder
.ConfigureAppConfiguration(configuration => configuration.AddJsonFile(NopConfigurationDefaults.AppSettingsFilePath, false, true))
.UseStartup<Startup>())
.Build()
.Run();
}
}
}
}
4 changes: 2 additions & 2 deletions upgradescripts/upgarade_to_4.40_and_above_readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Steps:
1. Make a backup of everything on your site, including the database. This is extremely important so that you can roll back to a running site no matter what happens during migration.
2. Remove all files from the previous version except \App_Data\dataSettings.json and \App_Data\plugins.json (move them to the safe place).
2. Remove all files from the previous version except JSON files in the 'App_Data' directory (dataSettings.json, plugins.json, appsettings.json), move them to the safe place.
3. Upload new site files
4. Copy back \App_Data\dataSettings.json and \App_Data\plugins.json files.
4. Copy back JSON files in the 'App_Data' directory.
5. Ensure that everything is OK

Notes:
Expand Down

0 comments on commit 6ca958b

Please sign in to comment.