Replies: 2 comments 1 reply
-
@yallie It may be a dumb idea, but what about the C# code? DryIoc may generateva valid C# code for the specified resolution roots. The runtime dependent resolutions (or holes in the graph) will be set to the appropriate |
Beta Was this translation helpful? Give feedback.
-
It may insert the |
Beta Was this translation helpful? Give feedback.
-
Hi Maksim,
MEF used to have a cool diagnostic library for browsing the container contents. The library fetched all registered parts (services), their exports/imports and their health status. It allowed to examine MEF composition container in runtime to diagnose resolution issues such as unsatisfied imports or single imports with matching multiple exports (cardinality mismatch). Plain vanilla MEF used to have a very poor diagnostic messages, so this library was a life saver. On top of this library was built a mefx command-line analysis tool, but I had my own UI built around it:
Unfortunately, the library was hosted on CodePlex and was abandoned (or merged into MEF and then abandoned, I'm not sure exactly), so the only thing left of it I could find online is this archived github repository, with no discussions, issues, etc. It has some documentation files: diagnostics.md.
So finally my question: is there a way to inspect a running DryIoc container to fetch all service registrations, examine their dependencies, etc., without actually creating them? I know we can start with container.GetServiceRegistrations() and try building expressions for each registered service, but expressions are not very easy to examine... Is there a way to find a collection of service dependencies, their expected cardinality (import single instance or import a collection), and health status (matching service is available or not)?
I've found a nice and handy container.Validate() method, but looks like it only reports resolution exceptions, such as missing or circular dependencies. Is there a way to build a service graph so I can visualize it? :)
Beta Was this translation helpful? Give feedback.
All reactions