Replace the use of dynamic with Reflection to support AOT#269
Replace the use of dynamic with Reflection to support AOT#269iancooper merged 5 commits intoBrighterCommand:masterfrom
Conversation
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
|
Thanks @SteveBush I'll take a look at some point today. |
iancooper
left a comment
There was a problem hiding this comment.
Thanks @SteveBush I can't really comment on the Maui stuff, as I only scratch the surface there. But the move away from dynamic looks fine to me.
|
I need to update the GHA build and dependencies before Darker will build properly. It looks like we didn't update it for dotnet 9. I'll do that a bit later, and let you know once the build is green. That way you can merge and your build should go green |
Thanks. Before the merge, I would also like to make some changes:
I will update the PR with these changes. |
…it issues in MauiTestApp
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
See issue #268
Replaced the use of (dynamic) with using reflection. Ahead Of Time compilation does not support runtime code generation, which is used by the cast for dynamic.
I added a Maui Test Application to validate the changes. It emulates SampleMinimalApi but from within an IOS, Android, WinUI, or MacCatalyst MAUI application. AOT compilation is only turned on for Release. AOT compilation also strips out all debugging information, so attaching a debugger is not supported. To fix something in MAUI, the general strategy is to get it working with unit tests first and then try it on the device.
I contributed some TestHelpers that I use in my personal development. A custom testcase base class, a logging provider that outputs to ITestOutputHelper, and their supporting methods.
Lastly, I made some design choices that I wanted to call out.