Merge pull request #4988 from sbwalker/dev
introduce RemoveAssemblies() method in UpgradeManager
This commit is contained in:
commit
8811a9bcaa
|
@ -481,43 +481,17 @@ namespace Oqtane.Infrastructure
|
||||||
"System.Text.Json.dll"
|
"System.Text.Json.dll"
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var assembly in assemblies)
|
RemoveAssemblies(assemblies, "6.0.1");
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
|
||||||
var filepath = Path.Combine(binFolder, assembly);
|
|
||||||
if (System.IO.File.Exists(filepath)) System.IO.File.Delete(filepath);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
// error deleting asesmbly
|
|
||||||
_filelogger.LogError(Utilities.LogMessage(this, $"Oqtane Error: 6.0.1 Upgrade Error Removing {assembly} - {ex}"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Upgrade_6_0_2(Tenant tenant, IServiceScope scope)
|
private void Upgrade_6_0_2(Tenant tenant, IServiceScope scope)
|
||||||
{
|
{
|
||||||
// remove MySql.EntityFrameworkCore package
|
// remove MySql.EntityFrameworkCore package (replaced by Pomelo.EntityFrameworkCore.MySql)
|
||||||
string[] assemblies = {
|
string[] assemblies = {
|
||||||
"MySql.EntityFrameworkCore.dll"
|
"MySql.EntityFrameworkCore.dll"
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var assembly in assemblies)
|
RemoveAssemblies(assemblies, "6.0.2");
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
|
||||||
var filepath = Path.Combine(binFolder, assembly);
|
|
||||||
if (System.IO.File.Exists(filepath)) System.IO.File.Delete(filepath);
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
// error deleting asesmbly
|
|
||||||
_filelogger.LogError(Utilities.LogMessage(this, $"Oqtane Error: 6.0.2 Upgrade Error Removing {assembly} - {ex}"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddPagesToSites(IServiceScope scope, Tenant tenant, List<PageTemplate> pageTemplates)
|
private void AddPagesToSites(IServiceScope scope, Tenant tenant, List<PageTemplate> pageTemplates)
|
||||||
|
@ -530,5 +504,23 @@ namespace Oqtane.Infrastructure
|
||||||
sites.CreatePages(site, pageTemplates, null);
|
sites.CreatePages(site, pageTemplates, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RemoveAssemblies(string[] assemblies, string version)
|
||||||
|
{
|
||||||
|
foreach (var assembly in assemblies)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var binFolder = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
|
var filepath = Path.Combine(binFolder, assembly);
|
||||||
|
if (System.IO.File.Exists(filepath)) System.IO.File.Delete(filepath);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
// error deleting asesmbly
|
||||||
|
_filelogger.LogError(Utilities.LogMessage(this, $"Oqtane Error: {version} Upgrade Error Removing {assembly} - {ex}"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user