From 0161c64e2c5e28929e211d6b7ee5e5c81c9fe552 Mon Sep 17 00:00:00 2001 From: fengjiayi <12821976+ning_xi@user.noreply.gitee.com> Date: Mon, 8 Sep 2025 13:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=B1=BB=E5=BA=93=E6=89=80=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E7=9A=84=E7=B1=BB=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NodeFlow/Tool/FlowLibraryAssemblyContext.cs | 19 +++++++++++++------ Workbench/Serein.Workbench.csproj | 1 - 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/NodeFlow/Tool/FlowLibraryAssemblyContext.cs b/NodeFlow/Tool/FlowLibraryAssemblyContext.cs index 28d9596..8363f28 100644 --- a/NodeFlow/Tool/FlowLibraryAssemblyContext.cs +++ b/NodeFlow/Tool/FlowLibraryAssemblyContext.cs @@ -28,17 +28,24 @@ namespace Serein.NodeFlow.Tool protected override Assembly? Load(AssemblyName assemblyName) { string? assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName); // 加载程序集 - if (!string.IsNullOrEmpty(assemblyPath)) + if (!string.IsNullOrEmpty(assemblyPath) && File.Exists(assemblyPath)) { - var assembly = Default.LoadFromAssemblyPath(assemblyPath); // 通过默认方式进行加载程序集及相关依赖 - //var assembly = LoadFromAssemblyPath(assemblyPath); - return assembly; + try + { + var assembly = Default.LoadFromAssemblyPath(assemblyPath); // 通过默认方式进行加载程序集及相关依赖 + return assembly; + } + catch (Exception ex) + { + var assembly = LoadFromAssemblyPath(assemblyPath); + return assembly; + } } else { - return Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName); + var assembly = Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName); + return assembly; } - // return null; // 构建依赖项的路径 diff --git a/Workbench/Serein.Workbench.csproj b/Workbench/Serein.Workbench.csproj index 0887490..21e22fc 100644 --- a/Workbench/Serein.Workbench.csproj +++ b/Workbench/Serein.Workbench.csproj @@ -69,7 +69,6 @@ -