-
Notifications
You must be signed in to change notification settings - Fork 392
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
Confusing analyzer warnings in solution explorer with no way to see any details #4893
Comments
@loop-evgeny there is the problem of #2257 where the nodes show a warning icon on the root without explaination, however the issue you point out is by design. These icons (which do not have color) are used to represent the severity of the analyzer result. Documentation is here: https://docs.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2019#analyzers-in-solution-explorer |
OK, so that list of icons just shows the warning defined in the analyzer DLLs and not warnings detected in my solution? Makes sense now, I guess, but with the warning icon it's certainly confusing. |
This is a very confusing indication indeed. Hope you find a better way of visualizing this in future. |
@secretwpn we're open to suggestions. |
I agree with the OP, the use of the yellow exclamation mark is profoundly confusing. I associate that with something like "dependency failed to load". If an analyzer loaded fine but generated a code warning, that's not something that should trigger an exclamation mark. In addition, I have analyzers giving me a bunch of warnings in the solution explorer view (such as "Do not call 'IServiceCollection.BuildServiceProvider' in 'ConfigureServices'"), but none of them appear in the Error List. This really needs to be done better. |
@jez9999 The yellow exclamation mark indicates a problem with the project. The gray exclamation is the one that is By Design. One of the images above shows both. |
@sharwell so how do we see the reason for the yellow triangle? |
@epvanhouten If I knew the answer to that question, I probably would see many fewer yellow triangles because I would have been able to fix them by now. 😆 |
@jmarolf Are we missing something here? How do we get at the information to make the IDE warnings go away? |
@drewnoakes what is the best way to diagnose these? |
In the ideal case, there's a warning in the error list. However often there's not, and they're diagnosed on a case-by-case basis. It's actually currently very difficult to diagnose these due to the design of the dependencies node. We're improving the design, but it will be a while before this is improved very much. In the meantime, if you have a repro that results in such a warning icon, please open an issue and include repro steps. |
@jez9999 the issue with analyzers has been addressed in the latest 16.5 preview. There are other cases that trigger the warning icon incorrectly, and we're working to fix them. |
Jeeeeezuz... these are annoying. Please, please, fix ASAP. To not be able to easily get an explanation is unforgivable in a product that costs $1,000s! |
These are annoying. Please, please, fix ASAP. |
Folks, the warning symbol on the analyzer node with the full path displayed has been fixed in 16.5 Preview. If you continue to see the warning on the analyzer node and you have that version installed, please open a new bug over https://github.com/dotnet/project-system/issues/new. |
I'll miss them when they're gone. |
Visual Studio Version: 16.1.1
Summary: The Analyzers node in Solution Explorer shows some items that seem to be warnings about the code, but there appears to be no way to see what code they refer to.
Steps to Reproduce:
Expected Behavior:
Either no warnings or I can double-click on the warning to go to the line of code where the problem occurs or there is a context menu item for this.
Actual Behavior:
Warnings such as "MVC1000 Use of IHtmlHelper.{0} should be avoided." and "EF1000 Possible SQL injection vulnerability." are shown:
There are no warnings in the Error list, even if I build the solution.
In my real project there are also warning icons, like this:
This is what first attracted my attention to it and I thought that the warning icons referred to the text of the child nodes, but when I create a new empty project I get those child text nodes without the warning icon. There seem to be other issues about the warning icons, such as #2257 and #4716.
User Impact: Confusion!
The text was updated successfully, but these errors were encountered: