fixes to emable module package installation from wwwroot/modules

This commit is contained in:
Shaun Walker
2020-04-11 14:02:42 -04:00
parent 93a09f6db8
commit dbcb973119
4 changed files with 41 additions and 28 deletions

View File

@ -1,7 +1,5 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
// DO NOT REMOVE - needed for client-side Blazor
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.AspNetCore;
using Microsoft.Extensions.DependencyInjection;
@ -14,11 +12,9 @@ namespace Oqtane.Server
public static void Main(string[] args)
{
var host = BuildWebHost(args);
// execute any database migrations for the framework or extensions
using (var serviceScope = host.Services.GetRequiredService<IServiceScopeFactory>().CreateScope())
{
var installationManager = serviceScope.ServiceProvider.GetService<IInstallationManager>();
// install any modules or themes stored in nugget, then restart app to ensure all is loaded in order
installationManager.InstallPackages("Modules,Themes", true);
var databaseManager = serviceScope.ServiceProvider.GetService<DatabaseManager>();
databaseManager.StartupMigration();
}