unitycontainer / microsoft-dependency-injection

Unity.Microsoft.DependencyInjection package
Apache License 2.0
63 stars 36 forks source link

FYI, Adding Unity Diagnostic extension breaks container #59

Closed pnmcosta closed 4 years ago

pnmcosta commented 4 years ago

Hi,

If we BuildServiceProvider using a Unity Container that has the Diagnostic extension it breaks the containers.

On my app, I couldn't actually Resolve a service with the Unity container with the extension, but could resolve with the ServiceProvider, I'm not 100% sure where the issue is (I'm relatively new to MS DI).

I've added https://github.com/pnmcosta/microsoft-dependency-injection/blob/testing/tests/UnityDiagnosticTests.cs to my fork, and 12 tests refuse to run, whereas https://github.com/pnmcosta/microsoft-dependency-injection/blob/testing/tests/UnityTests.cs without the Diagnostic extension works fine (well except for the RegistrationOrderIsPreservedWhenServicesAreIEnumerableResolved and ResolvesMixedOpenClosedGenericsAsEnumerable failing.

Cheers, P.

ENikS commented 4 years ago

Duplicate #47