Open ssteiner opened 4 months ago
What version are you using? Could you try DryIoc.Microsoft.DependencyInjection v8.0.0-preview-01?
I'm using version 6.2.0.
I finally figured out the culprit. In my Startup.cs 's ConfigureServices
I have this:
services.AddServerSentEvents(options =>
{
options.ReconnectInterval = 5000;
options.KeepaliveInterval = startupConfig.SseKeepAliveInterval;
options.KeepaliveMode = startupConfig.SseKeepAliveInterval > 0 ? ServerSentEventsKeepaliveMode.Always : ServerSentEventsKeepaliveMode.Never;
});
That's based on a package
When startupConfig.SseKeepAliveInterval
was 0, then problem would occurr, when it was > 0, no problem. AddServerSentEvents
is an extension that comes from the Lib.AspNetCore.ServerSentEvents
nuget package.
I'll give the preview a try - just found it very confusing that it errors out in what seems to be DryIoc.
@ssteiner You are getting the errors because it resolves (creates or gets) service via DryIoc.
The service is Singleton based on the stack trace.
DryIoc has done its work and is calling to the service constructor or factory method.
A service may fail its creation, usually wrapping the original exception in the TargetInvocationException
.
DryIoc will unwrap and re-throw the exception, trying to preserve a stack trace.
I'm using a mix of MS and DryIOC in my app. I've recently gone through some refactoring, and just before rolling out in prod, I noticed I'm getting an
ArgumentException
atTryInterpretSingletonAndUnwrapContainerException
. The exception happens when I start my app host, so it's somewhere deep down in the MS app host stack, no chance to figure out where.The full stacktrace is
The exception message is
Specified argument was out of the range of valid values. (Parameter 'value')'
which isn't particularly helpful (name of the argument? type? value?)Line 578 is the call to
host.Start()
and the host is build like this (abbreviated)Is there any chance to figure out what kind of type it was trying to resolve and with what arguments?