I have what is basically a default ASP.NET Core 2.2 project created from the default Razor Pages templates.
Now, in solution explorer -> Dependencies there is a node called "Analyzers".
First of all, at first I had no idea what it was for. I think I know now but it's still kind of fuzzy.
Secondly, why does it have a warning icon? Same with its child nodes.
Note: I'm not under the "NuGet" node, so this is not a question about missing dependencies or anything like that.
And thirdly; why is this "feature" there if it's only there to confuse me?!
ASP.NET Core provides an MVC analyzers package intended for use with web API projects. The analyzers work with controllers annotated with ApiControllerAttribute, while building on web API conventions. The analyzers package notifies you of any controller action that: Returns an undeclared status code.
Visual Studio Code lets you write ASP.NET Core applications by leveraging all of the evolved editing features available to C# and to the other file types in the project. Being a cross-platform itself, it's the perfect companion to start writing MVC applications for Linux, OS X and Windows.
Start Visual Studio, on the File menu select New, and then select Project. In the New Project dialog box, select Visual Basic or Visual C# as the programming language. In the Templates pane, select ASP.NET Empty Web Application, and name the project SofiaCarRentalWebApp. Click OK to create the solution and the project.
I had the same issue. After I restarted Visual Studio with Administrator privileges, Analyzers titles started to show the name instead of the path and the "warning" is gone.
EDIT
There is a GiHub issue about it.
A temporary fix would be to close the solution and to delete .dtbcache file in the .vs folder.
The warnings under each analyzer assembly are issues found in your code. Found by rules in those assemblies.
With the introduction of the Roslyn compilers it has become easier to analyse your sourcecode even before the compiler runs. These rules are packaged in special nuget packages. When these rules run they show in the error window and in this list.
If a rule misbehaves, or you want to turn it off or you want to look at just the MVC rules, this view is quite useful.
When analyzers themselves run into issues (some are not as good as others) the respective issues are also shown here. It looks like the RS* rules are actually issues with the rules themselves.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With