You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stackoverflow even with Diagnostic extension enabled #360
I've a strange behavior.
I'm using a HttpTaskAsyncHandler (aspnet 4.7.2) where i resolve a service from my child container.
This works most of the time, but if i do some fast curl calls then it throws a StackOverflowException.
I thought this should be catched by the Diagnostic extension?
To Reproduce
I'm not sure how to reproduce, as it's not happening on every request.
Look at lifetime strategy for simplest implementation. Diagnostic extension will show you how to add it to the container.
Basically you just add it do strategy chain and logg each request as it happens
The SpContext class has two constructors a public and an internal and somehow unity sometimes picks the internal.
The internal constructor uses the Uri as parameter. 😕
I think the InjectionConstructor attribute will fix that, so only the public constructor is used.
Activity
viceice commentedon Jul 20, 2023
Is there a way to inject some logging to the resolve calls, so i can see whats going on?
viceice commentedon Jul 20, 2023
Would be nice to get somewhere into this stack and log some diagnostics
ENikS commentedon Jul 20, 2023
You have a cyclical dependency somewhere in your graph:
> The 10 frame(s) above this were repeated 328 timesviceice commentedon Jul 20, 2023
I know, but it's not happening all the time. 🤔
ENikS commentedon Jul 20, 2023
If you can make a
strategywith a logger and plug it in, you could have all the diagnostics you want.viceice commentedon Jul 20, 2023
thanks, do you have some sample code?
I'll try that tomorrow.
ENikS commentedon Jul 20, 2023
viceice commentedon Jul 20, 2023
OK, found it
The
SpContextclass has two constructors a public and an internal and somehow unity sometimes picks the internal.The internal constructor uses the
Urias parameter. 😕I think the
InjectionConstructorattribute will fix that, so only the public constructor is used.