-
Notifications
You must be signed in to change notification settings - Fork 165
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
[ NativeAot ] Improve support #3417
Comments
We get these trim warnings from Realm:
|
Some of these are legitimate warnings, while others are warning about functionality that inherently relies on reflection to work correctly. I don't imagine we'll ever be able to get rid of all of them, but we can take a look and see if we can mitigate some of them. As a side note, as long as you don't use dynamic code ( |
@nirinchev Solving this doesn't require fixing all of these methods, but marking them as trim-incompatible by adding |
Problem
Currently attempt to use NativeAot leads to "Unhandled Exception: System.InvalidOperationException: No properties in Item, has linker stripped it?" exception. Expectedly, adding
Preserve
attribute has no effect in this case.MCVE (
RealmAot1
)csproj:
cs:
Workaround: add the assembly to custom rd
add to csproj
Custom.rd.xml
After that works good! But using
rd
is considered as bad practice, ideally it should just work.Also,
generating native code
step produces some warnings:How important is this improvement for you?
Would be a major improvement
Feature would mainly be used with
Local Database only
The text was updated successfully, but these errors were encountered: