af1152b001
Refactored all C# test files to use explicit namespace declarations and moved all using directives inside the namespace block for consistency. Updated assembly info and cache files to reflect the new build. Adjusted MvcTestingAppManifest.json to use fully qualified assembly names. No functional changes; all updates are related to code style, organization, and project metadata.
34 lines
947 B
C#
34 lines
947 B
C#
namespace Emby.Server.Implementations.Plugins;
|
|
|
|
using System.Reflection;
|
|
using System.Runtime.Loader;
|
|
|
|
/// <summary>
|
|
/// A custom <see cref="AssemblyLoadContext"/> for loading Jellyfin plugins.
|
|
/// </summary>
|
|
public class PluginLoadContext : AssemblyLoadContext
|
|
{
|
|
private readonly AssemblyDependencyResolver _resolver;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="PluginLoadContext"/> class.
|
|
/// </summary>
|
|
/// <param name="path">The path of the plugin assembly.</param>
|
|
public PluginLoadContext(string path) : base(true)
|
|
{
|
|
_resolver = new AssemblyDependencyResolver(path);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override Assembly? Load(AssemblyName assemblyName)
|
|
{
|
|
var assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName);
|
|
if (assemblyPath is not null)
|
|
{
|
|
return LoadFromAssemblyPath(assemblyPath);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|