Type dependency resolution needed
See original GitHub issueWe tries to sort types by dependencies prior to actual serialization:
Dependency solver method:
As you see, this method should fail to handle constructed generic types correctly (e.g. IPage in class jot_2 : ICompiledJot<IPage> if all dependent types and jot_2 would be in the same assembly) and throw cyclic dependency exception. Since, our current unit tests are more complex, I’ve tried completely removing the sorting by assuming metadata are already sorted for a given assembly and it worked.
Question: Is my assumption correct? If so, I will remove type dependency resolution completely. If not, I’ll improve it.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Understanding dependency resolution
Dependency resolution is a process that consists of two phases, which are repeated until the dependency graph is complete: When a new dependency...
Read more >Customizing resolution of a dependency directly
Dependency resolve rules provide a very powerful way to control the dependency resolution process, and can be used to implement all sorts of...
Read more >Determine the target type for a dependency during resolution
It seems to be impossible to determine the type for which a dependency is resolved: containerBuilder.Register(context => { // What is the type...
Read more >Type - Dependency Resolve (Dependency Resolution)
The process of finding an instance of a type dependency to use atrun time is known as resolving the dependency There are several...
Read more >Using generics for dependency resolution constraints
In most cases, it is indeed very weird to declare a generic type and then not use it. However, there is a potentially...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@vermorel I can confirm that the initial problem was solved completely and the last issue pointed out by @toptensoftware is a duplicate for the #127 that is defined more precisely. I suggest closing this one for now.
I’m pretty sure the cyclic dependency problem is solved and we are reserving all members (including constructors) before creating the types. The problem here is in handling closed generics in the GetConstructorHandle function.
It’s failing to find constructor handle for:
Which should get mapped (via a TypeSpec) to:
ie: this is part of a bigger problem with handling generics and not related to circular dependencies. I think there are many places where this kind of issue isn’t being handled correctly.