-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Make Source Generator for UseMiddleware #45528
Comments
Thanks for contacting us. We're moving this issue to the |
@eerhardt How come these warnings are coming from System.Linq.Expressions files? Has that project not been annotated for AOT yet? |
No, it hasn't. There are a lot of libraries in dotnet/runtime that haven't been annotated for AOT. See dotnet/runtime#75480. |
Thanks for contacting us. We're moving this issue to the |
Triage: Parking this back in .NET 8 Planning to avoid it surfacing in the triage query. |
When I
dotnet publish -c Release -p:PublishAot=true
the following app:We should create a Source Generator for
UseMiddleware
so we don't need to use Reflection on NativeAOT. See #45890Original issue (outdated)
I get the following AOT warnings stemming from the
UseMiddleware
method:This causes AOT warnings for ASP.NET apps that want to use EndPoints and Routing because we call
UseMiddleware
to enable these features:aspnetcore/src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs
Line 62 in f543e35
aspnetcore/src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs
Line 113 in f543e35
At a minimum, we should remove the AOT warnings from the above 2 callsites, so we can publish an ASP.NET Web API application for NativeAOT with no warnings.
As a follow up after that, we should consider a mechanism for solving this warning generally, for example with a source generator that generates the necessary code at compile-time.
The text was updated successfully, but these errors were encountered: