Aspnetcore.docs: How to use the Analyzers?

Created on 16 Apr 2019  Â·  4Comments  Â·  Source: dotnet/AspNetCore.Docs

[EDIT by @guardrex to put the code block in place.]

I do see Analyzers in my newly created ASP.NET Core 2.2 Visual Studio Project. However, I don't understand how to use them.

I changed one of the methods in values controller to the following code:

// GET api/values/5
[HttpGet("{id}")]
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
public ActionResult<string> Get(int id)
{
    if (id < 1) return NotFound();
    return "value";
}

It still compiles without a single error or warning.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P3 Source - Docs.ms

Most helpful comment

Still not getting any intellisense in vscode for this.

All 4 comments

Changed from what? What were you expecting?

@gzinger I also see no change. Did you get it to work?

I was expecting this.

When I build my project severeal warnings are present in the terminal, but in my class there are no warnings nor the option to fix the method.
vscode

Still not getting any intellisense in vscode for this.

Was this page helpful?
0 / 5 - 0 ratings