fix: PM should not depend on scoped plugin services, their lifetime is managed by scopes

This commit is contained in:
goat 2023-05-22 21:34:43 +02:00
parent 6a055783ba
commit 71bf9fdcf2
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -154,6 +154,10 @@ internal static class Service<T> where T : IServiceType
if (attr == null)
continue;
// Scoped plugin services lifetime is tied to their scopes. They go away when LocalPlugin goes away.
if (serviceType.GetServiceKind() == ServiceManager.ServiceKind.ScopedService)
continue;
ServiceManager.Log.Verbose("PluginManager MUST depend on {Type}", serviceType.FullName!);
res.Add(serviceType);
}