Convert Database projects so they build installable Packages rather than deploy to bin and modify installation to deploy Databases on demand as needed.

This commit is contained in:
Charles Nurse
2021-05-20 12:39:09 -07:00
parent 4474d49c6a
commit 47c04dc150
81 changed files with 434 additions and 143 deletions

View File

@ -101,26 +101,7 @@ namespace Microsoft.Extensions.DependencyInjection
if (!assemblies.Any(a => AssemblyName.ReferenceMatchesDefinition(assemblyName, a.GetName())))
{
try
{
var pdb = Path.ChangeExtension(dll.FullName, ".pdb");
Assembly assembly = null;
// load assembly ( and symbols ) from stream to prevent locking files ( as long as dependencies are in /bin they will load as well )
if (File.Exists(pdb))
{
assembly = AssemblyLoadContext.Default.LoadFromStream(new MemoryStream(File.ReadAllBytes(dll.FullName)), new MemoryStream(File.ReadAllBytes(pdb)));
}
else
{
assembly = AssemblyLoadContext.Default.LoadFromStream(new MemoryStream(File.ReadAllBytes(dll.FullName)));
}
Console.WriteLine($"Loaded : {assemblyName}");
}
catch (Exception e)
{
Console.WriteLine($"Failed : {assemblyName}\n{e}");
}
AssemblyLoadContext.Default.LoadOqtaneAssembly(dll, assemblyName);
}
}
}