sheru
❔ ✅ How to debug "More than twenty 'IServiceProvider' instances have been created ... "?
I am wondering if there's something wrong with how I used HTTP Context since it's mentioned in the error at the very bottom... Atlhough I don't really understand what it's saying. I only used HTTP Context here
47 replies
❔ ✅ How to debug "More than twenty 'IServiceProvider' instances have been created ... "?
I'm not sure if it's necessary to do this line
builder.Services.AddSingleton(npgsqlBuilder);
but I read somewhere that maybe this needs to be a singleton and shouldn't have an instance created every time. anyway the problem still persists47 replies
❔ ✅ How to debug "More than twenty 'IServiceProvider' instances have been created ... "?
I was taught that this is the way to go, using _config to get the default connection string in the appsettings.json. im not really sure how to feed it to dbcontext directly. I'm guessing using builder.services in program.cs? is it very significant to do it this way vs what you recommended?
47 replies