Ralms.EntityFrameworkCore.Extensions icon indicating copy to clipboard operation
Ralms.EntityFrameworkCore.Extensions copied to clipboard

[WRN] More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework

Open unknownuser90 opened this issue 7 years ago • 8 comments
trafficstars

I use your extensions to support the functionality of the hints in my app. But after some time EF starts to write the following messages to the logs:

More than twenty 'IServiceProvider' instances have been created for internal use by Entity Framework. This is commonly caused by injection of a new singleton service instance into every DbContext instance. For example, calling UseLoggerFactory passing in a new instance each time--see https://go.microsoft.com/fwlink/?linkid=869049 for more details. Consider reviewing calls on 'DbContextOptionsBuilder' that may require new service providers to be built.

If I disable registration of RalmsExtendFunctions() then the warning in the logs disappears. The code for the DbContext configuration looks like this:

services.AddDbContext<DbContext>(options =>
    options
        .UseSqlServer("connection string")
        .RalmsExtendFunctions());

unknownuser90 avatar Sep 20 '18 07:09 unknownuser90

Same problem

User1024ee avatar Sep 24 '18 15:09 User1024ee

@ralmsdeveloper is there any news on this issue?

unknownuser90 avatar Oct 11 '18 07:10 unknownuser90

@unknownuser90 I'm sorry, I've been very busy these days with company projects, I'll take some time out this week to update all my issues here.

Thank you!

ralmsdeveloper avatar Oct 11 '18 11:10 ralmsdeveloper

I will test if the fix for this problem has been fixed: https://github.com/aspnet/EntityFrameworkCore/issues/12927

ralmsdeveloper avatar Oct 11 '18 11:10 ralmsdeveloper

Is there any new information?

User1024ee avatar Oct 24 '18 12:10 User1024ee

@ralmsdeveloper is there any news?

unknownuser90 avatar Oct 30 '18 09:10 unknownuser90

yea. I corrected, sorry for the delay I have been very involved with the things of the company.

I will try to update the package until late afternoon.

ralmsdeveloper avatar Oct 30 '18 12:10 ralmsdeveloper

I will try to update the package until late afternoon.

@ralmsdeveloper is there any news?

unknownuser90 avatar Nov 06 '18 10:11 unknownuser90