![net5 依赖注入的时候,遇到的问题:Cannot consume scoped service from singleton IHostedService - lishidefengchen - 博客园 net5 依赖注入的时候,遇到的问题:Cannot consume scoped service from singleton IHostedService - lishidefengchen - 博客园](https://img2020.cnblogs.com/blog/569454/202103/569454-20210310131751122-860036.png)
net5 依赖注入的时候,遇到的问题:Cannot consume scoped service from singleton IHostedService - lishidefengchen - 博客园
![ASP.Net Core: How to inject scoped services into singleton services (or background services) - YouTube ASP.Net Core: How to inject scoped services into singleton services (or background services) - YouTube](https://i.ytimg.com/vi/xfzsHanIR5E/maxresdefault.jpg)
ASP.Net Core: How to inject scoped services into singleton services (or background services) - YouTube
![Cannot Consume Scoped Service From Singleton - A Lesson In ASP.NET Core DI Scopes - .NET Core Tutorials Cannot Consume Scoped Service From Singleton - A Lesson In ASP.NET Core DI Scopes - .NET Core Tutorials](https://dotnetcoretutorials.com/wp-content/uploads/2017/07/DotNetCoreTutorialsLogoNew.png)
Cannot Consume Scoped Service From Singleton - A Lesson In ASP.NET Core DI Scopes - .NET Core Tutorials
InvalidOperationException: Cannot consume scoped service · Issue #305 · Finbuckle/Finbuckle.MultiTenant · GitHub
![c# - Cannot consume scoped service 'ApplicationDbContext' from singleton 'Microsoft.Extensions.Hosting.IHostedService' - Stack Overflow c# - Cannot consume scoped service 'ApplicationDbContext' from singleton 'Microsoft.Extensions.Hosting.IHostedService' - Stack Overflow](https://i.stack.imgur.com/UsrUE.png)
c# - Cannot consume scoped service 'ApplicationDbContext' from singleton 'Microsoft.Extensions.Hosting.IHostedService' - Stack Overflow
![c# - Environment specific error: Cannot consume scoped service from singleton 'Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor' - Stack Overflow c# - Environment specific error: Cannot consume scoped service from singleton 'Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor' - Stack Overflow](https://i.stack.imgur.com/Gxo4G.jpg)