Stackoverflow error comes when adding serviceProvider
DEEPAK KUMPALA
191
Reputation points
I had Azure function
which was written using .NET Core 3.1
and suddenly stopped working and showing StackOverflow exception in below code at TryAddEnumerables
Here is my code
builder.Services
.AddSingleton<IConfiguration>(config)
.AddSingleton(serviceProvider => serviceProvider)
.AddLogging()
.AddSingleton<IManager, CManager>()
.AddSingleton<IRegexManager, RegexManager>()
When I comment the below line, StackOverflow error resolved BUT application does to work as expected.
.AddSingleton(serviceProvider => serviceProvider)
Here is stack trace
What might be the root cause? I have posted the same question here: https://stackoverflow.com/questions/75491471/stackoverflow-error-comes-in-microsoft-extensions-hosting-class
Sign in to answer