Avanade/NTangle

Publisher fails to start - error with dependency injection registrations

karpikpl opened this issue · 1 comments

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

@karpikpl - can you please retry with v1.0.3 - have been unable to reproduce this error.