8000 Handle IList and ISet for properties with AOT · Issue #5668 · NLog/NLog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Handle IList and ISet for properties with AOT #5668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snakefoot opened this issue Dec 29, 2024 · 2 comments
Closed

Handle IList and ISet for properties with AOT #5668

snakefoot opened this issue Dec 29, 2024 · 2 comments
Labels
breaking change Breaking API change (different to semantic change) platform support up-for-grabs
Milestone

Comments

@snakefoot
Copy link
Contributor
snakefoot commented Dec 29, 2024

Public properties that must be assigned from NLog.config-file or appsettings.json-file should return their actual types, instead of interfaces. AOT does not work well with creating instances of generic-types.

Should also create API-unit-test to ensure one doesn't introduce new public properties, that uses interfaces.

Should also consider having fallback-logic for often used types like: ISet<string> or IList<string>.

@snakefoot snakefoot added the breaking change Breaking API change (different to semantic change) label Dec 29, 2024
@snakefoot snakefoot added this to the 6.0 milestone Dec 29, 2024
@snakefoot
Copy link
Contributor Author

With #4036 then all non-nullable properties should return object, so the reflection logic can be changed to:

  • Use property-type when non-abstract
  • Use fallback logic with frequently used types: List<Layout> + List<string> + List<int> + HashSet<string> + HashSet<int>
  • Call property-getter and use type when non-null (and not readonly array)
  • Attempt to generate type from generic-interface-type (old logic that fails with AOT)

@snakefoot snakefoot changed the title Stop using IList and ISet but instead use List and HashSet for AOT Handle IList and ISet for properties with AOT Jan 2, 2025
@snakefoot
Copy link
Contributor Author

Resolved by #5718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Breaking API change (different to semantic change) platform support up-for-grabs
Projects
None yet
Development

No branches or pull requests

1 participant
0