-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[9.0-preview.5] OpenAPI with native AoT usage generates trim warnings #56023
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
Comments
@martincostello Sorry for the delay on this! I ran into some troublesome issues trying to install Powershell 7 on my DevBox to run the build script from your repo. I ended up setting up the repro on another machine. 😅 AFAICT, the warnings here fall into three categories:
Of the 3 categories above, the 2nd is the most important to tackle. I think there's a way to fix this though by piggy-backing off the static analysis that RDG does. |
Some updates on this:
Assuming all goes smoothly, we should have this wave of work resolved by preview7/RC1. Marking this as preview7 for now since I anticipate getting the |
Closing this one out since this will ship in preview7. We can track any follow-up issues independently. |
This reminds me - I tested the latest preview 7 build with the M.OpenApi 1.6.16 release this morning and all the trim warnings are gone now. I guess you can bump the dependency and remove the ILLink warning workarounds now. |
I'm trying to see if I can get microsoft/OpenAPI.NET#1719 into a release and then to an update after that. If I run out of time, I'll bump the dependency with just the native Aot changes. |
Is there an existing issue for this?
Describe the bug
Playing about with the native AoT support for the OpenAPI functionality with nightly builds of .NET 9 preview.5, trim warnings are generated from assemblies referenced by Microsoft.AspNetCore.OpenApi. This causes an application using
TreatWarningsAsErrors=true
to fail to compile when published.Below are the warnings that appear to come from the framework itself when using
MapOpenApi()
:The repro below includes some others from my own code, but ignore those as I was just messing around trying to replicate some NSwag functionality I have to generate examples using the new functionality for OpenAPI (from where the suggestion in #56022 came from).
Expected Behavior
The application builds with no trim warnings from ASP.NET Core itself when
MapOpenApi()
is used in an application published for native AoT.Steps To Reproduce
build.ps1 -SkipTests
from the root of the repositoryExceptions (if any)
None.
.NET Version
9.0.100-preview.5.24281.15
Anything else?
No response
The text was updated successfully, but these errors were encountered: