Skip to content

Feature request: Run analyzers in debug mode #18791

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

Open
Rick-Anderson opened this issue Feb 4, 2020 · 6 comments
Open

Feature request: Run analyzers in debug mode #18791

Rick-Anderson opened this issue Feb 4, 2020 · 6 comments
Labels
affected-medium This issue impacts approximately half of our customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform severity-nice-to-have This label is used by an internal tool
Milestone

Comments

@Rick-Anderson
Copy link
Contributor

Rick-Anderson commented Feb 4, 2020

Problem motivation: #18768, app.UseSpa was in the wrong order.

Add app.UseRunAllAnalyzers to template code to detect middleware order and other problems.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    if (env.IsDevelopment())
    {
        app.UseDeveloperExceptionPage();
        app.UseDatabaseErrorPage();
        app.UseRunAllAnalyzers();   // run middleware order check and other checks
    }
    else
    {
        app.UseExceptionHandler("/Error");
        app.UseHsts();
    }

    ...

UseRunAllAnalyzers could be updated frequently to add more checks.

See https://twitter.com/davidfowl/status/1228902288627912705 where @davidfowl requests this.

cc @javiercn

@mkArtakMSFT mkArtakMSFT added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Feb 5, 2020
@javiercn javiercn added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Feb 5, 2020
@javiercn
Copy link
Member

javiercn commented Feb 5, 2020

@Rick-Anderson thanks for following up.

@mkArtakMSFT I'm moving this to next milestone planning so that we can look at it then and decide.

@Rick-Anderson
Copy link
Contributor Author

See #20709, caused by middleware in the wrong order.

@Rick-Anderson
Copy link
Contributor Author

How to use Static Files with CatchAll Routing? #18038
Yet another issue that could have been detected.

@mkArtakMSFT mkArtakMSFT added feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Jun 16, 2020
@mkArtakMSFT
Copy link
Contributor

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.

@Rick-Anderson
Copy link
Contributor Author

For future reference, here's an easy one to miss.

UseHsts depends on the request scheme being updated, therefore UseForwardedHeaders must be called before UseHsts.

@Rick-Anderson
Copy link
Contributor Author

Here's another
Order of UseStatusCodePagesWithReExecute and UseRouting shouldn't matter #19374

@wtgodbe wtgodbe added affected-few This issue impacts only small number of customers severity-nice-to-have This label is used by an internal tool affected-medium This issue impacts approximately half of our customers and removed affected-few This issue impacts only small number of customers labels Dec 21, 2020
@Rick-Anderson Rick-Anderson changed the title Feature request for 5.0: Run analyzers in debug mode Feature request: Run analyzers in debug mode Jun 16, 2022
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-medium This issue impacts approximately half of our customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform severity-nice-to-have This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

6 participants