Open
Description
There are places where features use different APIs if the app is published with native AOT. For example, routing uses IL emit to generate custom lookup tables when IsDynamicCodeSupported
is true, and falls back to dictionary lookup when it is false.
We should have unit tests that execute tests with native AOT to verify these code paths work correctly. Code that tests IsDynamicCodeSupported
or IsDynamicCodeCompiled
are likely candidates.
Known places that should have native AOT testing:
- Building route DFA
- ProblemDetails + Extensions
- MapXXX methods + request filters
- Generic host + value type container builder (verify that error is thrown)
- Invoke middleware with parameters [AOT] Add middleware reflection fallback #45890
- PopulateMetadata fallback
https://github.com/dotnet/runtime has a pattern for this type of testing. We should look at what runtime do.