Closed bielu closed 6 months ago
Which IHostedService is being resolved and gives the exception?
@desjoerd https://github.com/umbraco/Umbraco-CMS/blob/36402a149ad205f0bc9c55166c014bf68c8a8b8b/src/Umbraco.Core/Services/IRuntime.cs#L8 and it gives excaption as umbraco is trying to boot and create DI container but it requires IRuntime https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.Common/Extensions/WebApplicationExtensions.cs#L26
Hmm, I think the removal of IHostedService registrations is too greedy.
if(typeof(IHostedService).IsAssignableFrom(services[i].ServiceType)
That probably should be just an equals. I will check this on Monday whether this would solve the Umbraco issue and prevent background services from running.
I verified with a few tests that the removal of IHostedService registrations should only look at the specific interface and not too base interfaces.
Within Umbraco the IRuntime implements IHostedService and there is a registration just registering it as IRuntime
. And a registration for the HostedService -> https://github.com/umbraco/Umbraco-CMS/blob/36402a149ad205f0bc9c55166c014bf68c8a8b8b/src/Umbraco.Web.Common/Hosting/HostBuilderExtensions.cs#L36-L37
Hi! I was looking into generating Typecript services and models with usage of nswag, but noticed that it will not work because of : https://github.com/RicoSuter/NSwag/blob/116c636fb7491623eb6c70725b8fb20c450ec96c/src/NSwag.Commands/HostApplication.cs#L112C23-L119C26 I am trying understand why it was introduced when using GetServiceProviderWithHostFactoryResolver. As right now I can't generate models when using umbraco cms, as it will throw me missing services which are host services!