Publisher fails to start - error with dependency injection registrations
karpikpl opened this issue · 1 comments
karpikpl commented
error thrown:
System.InvalidOperationException: Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.Hosting.IHostedService Lifetime: Singleton ImplementationType: Properties.Legacy.Cdc.Publisher.Services.HotelHostedService': Cannot consume scoped service 'NTangle.Services.IServiceSynchronizer' from singleton 'Microsoft.Extensions.Hosting.IHostedService'.
when running generated Publisher (no changes except connection string)
this line:
.AddFileLockSynchronizer()
had to be replaced by
.AddSingleton<IServiceSynchronizer, FileLockSynchronizer>()
to fix the issue