Repository navigation
Document that delegate factories require runtime code generation - #219
Merged
Merged
Conversation
Delegate factories compile an expression tree when the factory type is first resolved, so they fail under Mono full AOT - the mode iOS and MAUI release builds use. There is no fix short of full source generation, so the page now records the exception verbatim for searchability and shows the explicit resolve that replaces the factory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to autofac/Autofac#1449
Delegate factories compile an expression tree the first time the factory type is resolved, so they throw under Mono full AOT - the mode iOS and MAUI release builds use. Supporting them there would mean replacing the expression tree with source generation, which we are not planning to do, so the limitation is documented instead.
Proposed Changes
ExecutionEngineExceptiontext verbatim, since the exception names a generated dynamic method rather than anything recognizable, and someone hitting it has nothing better to search for.ResolvewithNamedParameterthat replaces the factory, matching the by-name parameter semantics delegate factories use.Notes
doc8andsphinx-build -Wboth pass.Scoped to Mono full AOT deliberately. The repo's AOT smoke test covers parameterless
Func<T>under .NET Native AOT and it passes, so this does not claim the feature is broken everywhere - the existing Native AOT page already carries the general picture and is left alone.