-
Notifications
You must be signed in to change notification settings - Fork 10.3k
install .net8.0 aot 'Swashbuckle.AspNetCore.Filters.AddResponseHeadersFilter' could not be located #53125
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
only run by visual studio some error
|
I removed, OperationFilter related code, no error after packaging, but some controllers access all 404 so , this error should probably not be ignored when the development tools are running, System.InvalidOperationException: Startup assembly Microsoft.WebTools.ApiEndpointDiscovery failed to execute. I don't know how to fix this error |
I doubt that Swashbuckle is inherently marked at AoT compatible or trim-friendly, and various parts of ASP.NET Core itself are not yet supported with AoT even in .NET 8, such as MVC, where a lot of the API Explorer code used for Open API support lives. You could try rooting the Swashbuckle assemblies using to stop the AoT compiler from removing any of the types which might resolve the problem: https://learn.microsoft.com/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-8-0#root-assemblies I think however your application's use cases are not currently supported for native AoT, in which case you'd either need to refactor things to only use Swashbuckle when native AoT is disabled, remove it completely, or wait until a time that MVC supports native AoT in some future major version of ASP.NET Core. |
Running in the development tool is normal, but after performing AOT, the controller is no longer accessible and seems to have been cropped |
@martincostello just deleted the code for the filter. Although this error did not occur, the entire controller disappeared and cannot be accessed. It shows 404 and can only access the code I configured on the homepage
this is worked ,but controller is cannot access ,404 |
@martincostello In fact, AOT ,I have tested many new versions, 7.0.4 and previous versions, and I have solved the problems I encountered through rd.xml and source generation. However, I will encounter various strange problems in any subsequent version, But I don't know how to solve it |
how to use ?
|
Yes like that.
Even if it happened to work before, native AoT is only supported in ASP.NET Core 8 but is not supported for all ASP.NET Core scenarios. The supported, partially supported, and not supported scenarios are documented here. |
@martincostello thank you ,very very very |
May I ask how to use the controller normally after enabling AOT and prohibit deleting the MVC controller? Now accessing controller 404, I want to continue using it, @martincostello |
I'm afraid I don't know - MVC is not supported with native AoT. |
Is there an existing issue for this?
Describe the bug
My computer has .NET 8.0 installed but my project is configured with .NET 7.0 using ASP .NET Core Swagger, this project used to work correctly, I did some version upgrades to these libraries later, and I reinstalled my computer, resulting in these headaches
System.InvalidOperationException: A suitable constructor for type 'Swashbuckle.AspNetCore.Filters.AddResponseHeadersFilter'
have configured both the rd.xml and source generation related to AOT, but these issues have occurred due to the computer being reinstalled
Reproduction Steps
Expected Behavior
open url display web
Steps To Reproduce
Exceptions (if any)
.NET Version
8.0
Anything else?
The text was updated successfully, but these errors were encountered: