-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception is thrown on non-standard IOC container due to use of Concrete classes. #5537
Comments
Hey @PeterOscarsson any chance you could give me a small repro app using Unity + 1.8 OtlpExporter I can use to debug? |
Sure, put the attached project in the OpenTelemetry catalog and put a breakpoint on Check with and without "UseUnityServiceProvider" in main Program. |
Thank you @PeterOscarsson! I opened this issue over in Unity: unitycontainer/microsoft-dependency-injection#96 I'm not opposed to just switching to an interface but I figured it would be good to gather their thoughts on the differing behavior before we took action. Seems like a behavior they might want to fix to prevent other things from breaking when choosing to use Unity over the M.S.E.DI container 🤷 |
@CodeBlanch ,Thats great, but I doubt you'll get an answer. Seems like its no longer activly maintained. Else I would have taken this up with them. |
Hey, we're affacted by this issue as well. We'll appreciate if you could use interface for this feature instead of concrete class to make it work with Unity. Thanks! |
@CodeBlanch , an update for Unity, is that there will be no answer from the maintainer as he passed away last christmas. :-( Our company are currently investigating if we should switch DI container(not found a good enough yet) or fork the Unity one and continue using it. In the meantime we would be grateful for a fix to this "problem". |
OpenTelemetry.Exporter 1.8
net8.0
Upgrading from 1.7 to 1.8 without any changes to our codebase.
This code is throwing exception:
My guess is that as we are using a non-default ServiceProvider (IUnityContainer), we get a concrete class even though it is not registred in the service collection.
Is it possible to refactor to use interfaces instead of concrete classes?
This is the only instance in all of the codebase we are using (asp.net mvc+ blazor, redis cache, Masstransit, ..) where this is a problem.
The text was updated successfully, but these errors were encountered: