Enum TypeDiscoveryMode
- Namespace
- Cratis.Types
- Assembly
- Cratis.Fundamentals.dll
Represents how the assemblies behind a ITypes were arrived at.
public enum TypeDiscoveryMode
- Extension Methods
Fields
Explicit = 1The assembly providers were supplied by the caller, so neither automatic strategy was chosen.
Generated = 2Compile-time generated providers were registered and used exclusively; the reflection fallback was skipped.
A generated provider registers itself from a module initializer, which runs when the CLR loads its assembly. The universe therefore holds the assemblies that had been loaded at that moment, and an assembly loaded later contributes nothing. Assemblies is the list of the ones that did contribute.
Reflected = 3No generated providers were registered, so the project- and package-reference closures were walked by reflection.
This does not currently occur. Cratis.Fundamentals is itself built with the type discovery generator, so its own module initializer registers a provider as the CLR loads the assembly - which necessarily happens before anything can reach Types at all. The registry is therefore never empty and the fallback is never taken. The value stays because the fallback is still there and still correct; if the generator ever stops running over this assembly, this is what a consumer would see.
Unknown = 0The ITypes did not say - it does not implement DiscoveryMode and took the interface's default.
Remarks
The choice is made once, when the type universe is built, and holds for the lifetime of that ITypes. It is reported because the two automatic modes have different failure characteristics: Generated sees exactly the assemblies whose module initializers had run by then, while Reflected walks the dependency closure and does not care what is loaded.