-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Source generation seemingly not working when using minimal APIs and top level statements #86
Comments
Can confirm reproduction, |
Investigating, thanks |
tracking via #87 |
Just tested it: everything working as expected. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When building a sample application using minimal APIs and top level statements (sample linked below), it seems like the source generation isn't working as expected. Even though adding the
[module:DapperAot]
, compiling producesWarning DAP005 : 1 candidate Dapper methods detected, but none have Dapper.AOT enabled
, and running the application results in the expected errors, due to not being able to use dynamic code generation under Native AOT.If I move the code to a static class and map the endpoint, then the warning disappears and everything works as expected.
I imagine this isn't a very relevant issue, as in non-sample code, it's unlikely to have queries in top level statements, but just in case it's an unknown issue (or maybe I'm using it wrong), I thought of reporting.
Where are you seeing this?
To Reproduce
Sample code
Note: out of the box this code works, because the direct route to code is commented out and replaced with a static class, but reverting things, we can see the reported issue.
Expected behavior
Source generation works regardless of where the queries are used.
However, if supporting this scenario is not worth the effort, maybe include it as a known limitation in the docs.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: