-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Should we disable asp0014 when using WebApplication.CreateEmptyBuilder()
#50732
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
Thanks for the bug report, @WeihanLi! Yes, we should avoid emitting this diagnostic for web apps not configured with the routing middleware. Let me see how easy this is to fix on the analyzer side... |
I just took a quick look, but it seems like this would be relatively straight forward. Right now we're emitting the diagnostic for any method on Maybe we could pass an array of excluded method symbols to the Edit: I took a closer look into this, and it's definitely not as straightforward as I originally thought, as discussed below. |
Seemed we're emitting the |
Yep! The challenge here is that we want to continue emitting the warning about |
Backlogging this for now. Was hopping I'd be able to tackle this for 9.0-preview1 but that turned out to not be the case. PRs welcome on this though! |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Since the empty WebAplicationBuilder would not register routing, maybe we could disable the
ASP0014
using top-level route registrations diagnostic?We may use the code like below, currently we would get

ASP0014
warningDescribe the solution you'd like
Ignore it when using the empty
WebApplicationBuilder
since no default global routingAdditional context
No response
The text was updated successfully, but these errors were encountered: