mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Fix plugin dependencies not getting loaded
This commit is contained in:
@@ -9,3 +9,4 @@ using System.Diagnostics.CodeAnalysis;
|
||||
[assembly: SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "No need to")]
|
||||
[assembly: SuppressMessage("Minor Code Smell", "S1075:URIs should not be hardcoded", Justification = "<Pending>")]
|
||||
[assembly: SuppressMessage("Critical Code Smell", "S2696:Instance members should not write to \"static\" fields", Justification = "<Pending>", Scope = "member", Target = "~P:DesktopMagic.DataContexts.MainWindowDataContext.Settings")]
|
||||
[assembly: SuppressMessage("Major Code Smell", "S3885:\"Assembly.Load\" should be used", Justification = "Assembly.Load does not load dependencies", Scope = "member", Target = "~M:DesktopMagic.PluginWindow.ExecuteSource")]
|
||||
|
||||
@@ -202,8 +202,7 @@ public partial class PluginWindow : Window
|
||||
object? instance = pluginClassInstance;
|
||||
if (instance is null)
|
||||
{
|
||||
byte[] assemblyBytes = File.ReadAllBytes($"{PluginFolderPath}\\main.dll");
|
||||
Assembly dll = Assembly.Load(assemblyBytes);
|
||||
Assembly dll = Assembly.LoadFrom($"{PluginFolderPath}\\main.dll");
|
||||
Type? instanceType = Array.Find(dll.GetTypes(), type => type.GetTypeInfo().BaseType == typeof(Plugin));
|
||||
|
||||
if (instanceType is null)
|
||||
|
||||
Reference in New Issue
Block a user