unitycontainer / microsoft-logging

Adapter for Microsoft.Extensions.Logging
Apache License 2.0
16 stars 6 forks source link

Automatic constructor registration issue #8

Open pnmcosta opened 5 years ago

pnmcosta commented 5 years ago

Hi,

This is not working if you rely on automatic constructor registration, https://unitycontainer.github.io/tutorials/registration/Type/Constructor/automatic.html

I've forked this repo, and updated all the dependencies to Unity 5.11.1 and Logging Abstractions 3.0.0

If you add an empty constructor to the LoggedType in the unit test, and run them, it will fail. Unity is probably not picking up ILogger and ILogger<> as resolvable types.

Is this expected behaviour? Or could something be done about it? Because if you use dependencies that do resolve, it will pick the correct constructor (the one with the most arguments)

Thanks, P.