Packages: a package resolves a relative project path and loads its assemblies into the session's container

- Package: resolve a relative project path before loading it as an implicit package
- Packages: a package of a session loads its assemblies into the session's container whoever asks (UpdateAssemblyReferences after a failed first load used the process default one, so a dependent assembly bound to a second copy of its dependency next to itself and the serializer registry rejected it)
This commit is contained in:
Virgile Bello
2026-10-06 22:50:50 +09:00
parent dd9ebaf962
commit 2575cd06bc
+6 -1
View File
@@ -637,6 +637,8 @@ public sealed partial class Package : IFileSynchronizable, IAssetFinder
public static PackageContainer LoadProject(ILogger log, string filePath)
{
filePath = FileUtility.GetAbsolutePath(filePath);
if (SupportedProgrammingLanguages.IsProjectExtensionSupported(Path.GetExtension(filePath).ToLowerInvariant()))
{
var projectPath = filePath;
@@ -1032,7 +1034,10 @@ public sealed partial class Package : IFileSynchronizable, IAssetFinder
{
ArgumentNullException.ThrowIfNull(log);
ArgumentNullException.ThrowIfNull(loadParameters);
var assemblyContainer = loadParameters.AssemblyContainer ?? AssemblyContainer.Default;
// A package of a session loads into the session's container whoever asks (the load, a later
// UpdateAssemblyReferences): one container means one copy of each assembly, so a dependent assembly
// binds to the copy already loaded rather than to another one next to itself
var assemblyContainer = loadParameters.AssemblyContainer ?? Session?.AssemblyContainer ?? AssemblyContainer.Default;
// Load from package
if (Container is StandalonePackage standalonePackage)