-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Add RequiresDynamicCode attribute to dynamic methods/members #3347
Comments
I am working on this. |
@Freelancingonupwork let us know (here or in discord) if you have questions. I suspect this issue will require some research and experimentation - at least it would for me, as I haven't explored the AOT stuff in .NET yet. The core of the issue here, is that AOT will "optimize" code that it thinks isn't being called, so the compiler literally removes the code from the compiled output. My understanding is that there are attributes that we can apply to the code to tell AOT that the code should be kept as part of the compiled output, even if it would normally have been optimized away. I kind of suspect this will also affect business classes. For example, all the data portal operation methods (like |
Best process in my experience how to annotate project for AOT is following
Now after recording all work, you diligently find most trivial warnings which you can completely eliminate from the list.
Example of how legacy codebases did that https://github.com/dotnet/SqlClient/pull/1959/files#diff-844a96fe684c7aecaa27e22d292e57d4418d2c9c591b62dcf4b0a4f90d918bb1R22 |
@kant2002 any progress on this effort? |
Generally speaking, CSLA will not work with ahead-of-time compilation (AOT) because it makes use of unbounded generic types, reflection, expression trees, and other features that are incompatible with AOT.
To be a good citizen, we should mark methods that build expressions, use reflection, etc. with the
RequiresDynamicCode
attribute.https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/fixing-warnings
The text was updated successfully, but these errors were encountered: