mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-30 11:33:23 +08:00
修复了无法加载类库所依赖的类库
This commit is contained in:
@@ -28,17 +28,24 @@ namespace Serein.NodeFlow.Tool
|
|||||||
protected override Assembly? Load(AssemblyName assemblyName)
|
protected override Assembly? Load(AssemblyName assemblyName)
|
||||||
{
|
{
|
||||||
string? assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName); // 加载程序集
|
string? assemblyPath = _resolver.ResolveAssemblyToPath(assemblyName); // 加载程序集
|
||||||
if (!string.IsNullOrEmpty(assemblyPath))
|
if (!string.IsNullOrEmpty(assemblyPath) && File.Exists(assemblyPath))
|
||||||
{
|
{
|
||||||
var assembly = Default.LoadFromAssemblyPath(assemblyPath); // 通过默认方式进行加载程序集及相关依赖
|
try
|
||||||
//var assembly = LoadFromAssemblyPath(assemblyPath);
|
{
|
||||||
return assembly;
|
var assembly = Default.LoadFromAssemblyPath(assemblyPath); // 通过默认方式进行加载程序集及相关依赖
|
||||||
|
return assembly;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
var assembly = LoadFromAssemblyPath(assemblyPath);
|
||||||
|
return assembly;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName);
|
var assembly = Default.Assemblies.FirstOrDefault(x => x.FullName == assemblyName.FullName);
|
||||||
|
return assembly;
|
||||||
}
|
}
|
||||||
|
|
||||||
// return null;
|
// return null;
|
||||||
|
|
||||||
// 构建依赖项的路径
|
// 构建依赖项的路径
|
||||||
|
|||||||
@@ -69,7 +69,6 @@
|
|||||||
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
||||||
<ProjectReference Include="..\NodeFlow\Serein.NodeFlow.csproj" />
|
<ProjectReference Include="..\NodeFlow\Serein.NodeFlow.csproj" />
|
||||||
<ProjectReference Include="..\Serein.Extend.NewtonsoftJson\Serein.Extend.NewtonsoftJson.csproj" />
|
<ProjectReference Include="..\Serein.Extend.NewtonsoftJson\Serein.Extend.NewtonsoftJson.csproj" />
|
||||||
<ProjectReference Include="..\Serein.Proto.Modbus\Serein.Proto.Modbus.csproj" />
|
|
||||||
<ProjectReference Include="..\Serein.Script\Serein.Script.csproj" />
|
<ProjectReference Include="..\Serein.Script\Serein.Script.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user