Closed matiassilioni closed 10 months ago
@matiassilioni,
This is going to be an "I take pull requests". If you have a specific recommendation though, I'm all ears.
In the meantime, I strongly recommend against directly injecting primitive values like strings, numbers, Uris. My personal approach is to use strong typed settings or options classes instead. That might help a bit.
Hey, I've been through this error a few times, so I consider that the exception message should give more details.
In this case, I have a string parameter, which wasn't provided in the DI configuration by mistake, so in runtime, it failed. The exception is just showing the parameter name, but not the constructor or type. When the DI is way big, it's super hard to trace which class/constructor is misconfigured.
To find it I had to pull the source and add it to my solution to finally debug it and figure it out.
Note that neither the exception message nor the stack trace displays relevant information.
The proposed solution, log the parameter.Member.DeclaringType property too
To finally have something like this: