Revert "Load plugin into the default context if preferedSharedTypes"

This reverts commit 88038b8aab.
This commit is contained in:
nicolas.dorier 2025-05-25 09:33:38 +09:00
parent 88038b8aab
commit 6de46986e4
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 4 additions and 7 deletions

View File

@ -33,7 +33,7 @@
</PropertyGroup>
<PropertyGroup>
<PackageVersion>1.4.5</PackageVersion>
<PackageVersion>1.4.4</PackageVersion>
</PropertyGroup>
<Import Project="$(MSBuildProjectDirectory)\releasenotes.props"

View File

@ -178,12 +178,9 @@ namespace McMaster.NETCore.Plugins.Loader
public Assembly LoadAssemblyFromFilePath(string path)
{
var ctx = _preferDefaultLoadContext
? _defaultLoadContext
: this;
if (!_loadInMemory)
{
return ctx.LoadFromAssemblyPath(path);
return LoadFromAssemblyPath(path);
}
using var file = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read);
@ -191,9 +188,9 @@ namespace McMaster.NETCore.Plugins.Loader
if (File.Exists(pdbPath))
{
using var pdbFile = File.Open(pdbPath, FileMode.Open, FileAccess.Read, FileShare.Read);
return ctx.LoadFromStream(file, pdbFile);
return LoadFromStream(file, pdbFile);
}
return ctx.LoadFromStream(file);
return LoadFromStream(file);
}