Skip to content

Commit

Permalink
load unmanaged dll from dependencyResolver as well
Browse files Browse the repository at this point in the history
  • Loading branch information
taooceros committed Sep 11, 2023
1 parent 5c7141d commit 63b2a07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Flow.Launcher.Core/Plugin/PluginAssemblyLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,22 @@ protected override Assembly Load(AssemblyName assemblyName)

return existAssembly ?? (assemblyPath == null ? null : LoadFromAssemblyPath(assemblyPath));
}

protected override IntPtr LoadUnmanagedDll(string unmanagedDllName)
{
var path = dependencyResolver.ResolveUnmanagedDllToPath(unmanagedDllName);
if (!string.IsNullOrEmpty(path))
{
return LoadUnmanagedDllFromPath(path);
}

return IntPtr.Zero;
}

internal Type FromAssemblyGetTypeOfInterface(Assembly assembly, Type type)
{
var allTypes = assembly.ExportedTypes;
return allTypes.First(o => o.IsClass && !o.IsAbstract && o.GetInterfaces().Any(t => t == type));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<UseWindowsForms>true</UseWindowsForms>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down

0 comments on commit 63b2a07

Please sign in to comment.