|
// <auto-generated/>
using System;
using System.IO;
using System.Reflection;
using System.Runtime.Loader;
internal class StartupHook
{
public static void Initialize()
{
var startupHookAssembly = Assembly.GetExecutingAssembly();
var testBinDirectory = Path.GetDirectoryName(startupHookAssembly.Location);
AssemblyLoadContext.Default.Resolving += (context, assemblyName) =>
{
var candidatePath = Path.Combine(testBinDirectory, assemblyName.Name + ".dll");
if (File.Exists(candidatePath))
{
return context.LoadFromAssemblyPath(candidatePath);
}
return null;
};
}
} |