EntityframeworkCore
-
[EntityFramework Core] Worker 서비스에 DBContext DI 설정에 의한 System.AggregateException 오류 발생시 처리.NET/개념 및 유용한 팁 2021. 2. 18. 22:38
Worker 서비스 개발 중 아래와 같은 오류를 접하였다. System.AggregateException: 'Error while validating the service descript(Error while validating the service descriptor 'ServiceType: Microsoft.Extensions.Hosting.IHostedService Lifetime: Singleton ImplementationType: Cannot consume scoped service ASP.NET Core에선 나오지 않았던 오류인데 대충 해석하면 Singleton lifecycle 기반으로 동작하는 BackgroundService Worker에 Scoped 으로 설정된 서비스는 의존성 주입(D..