Fixed: Don't load Radarr.Core.dll as part of Radarr.Update

This commit is contained in:
ta264 2019-10-15 21:45:41 +01:00 committed by Qstick
parent 2a15113a74
commit 9fe978319e
2 changed files with 5 additions and 3 deletions

View File

@ -40,8 +40,10 @@ namespace NzbDrone.Common.Composition
_loadedTypes.AddRange(AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.Combine(_startupPath, $"{assemblyName}.dll")).GetTypes()); _loadedTypes.AddRange(AssemblyLoadContext.Default.LoadFromAssemblyPath(Path.Combine(_startupPath, $"{assemblyName}.dll")).GetTypes());
} }
var toRegisterResolver = new List<string> { "System.Data.SQLite" };
toRegisterResolver.AddRange(assemblies.Intersect(new [] { "Radarr.Core" }));
RegisterNativeResolver(toRegisterResolver);
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ContainerResolveEventHandler); AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ContainerResolveEventHandler);
RegisterNativeResolver(new [] {"System.Data.SQLite.dll", "Radarr.Core.dll"});
#endif #endif
Container = new Container(new TinyIoCContainer(), _loadedTypes); Container = new Container(new TinyIoCContainer(), _loadedTypes);
@ -70,7 +72,7 @@ namespace NzbDrone.Common.Composition
foreach (var name in assemblyNames) foreach (var name in assemblyNames)
{ {
var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath( var assembly = AssemblyLoadContext.Default.LoadFromAssemblyPath(
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, name) Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{name}.dll")
); );
try try

View File

@ -143,7 +143,7 @@ namespace NzbDrone.Test.Common.AutoMoq
AddTheAutoMockingContainerExtensionToTheContainer(container); AddTheAutoMockingContainerExtensionToTheContainer(container);
#if NETCOREAPP3_0 #if NETCOREAPP3_0
ContainerBuilderBase.RegisterNativeResolver(new [] {"System.Data.SQLite.dll", "Radarr.Core.dll"}); ContainerBuilderBase.RegisterNativeResolver(new [] {"System.Data.SQLite", "Radarr.Core"});
#endif #endif
} }