roslyn
roslyn copied to clipboard
Suppress No Longer Showing in Error List
This issue has been moved from a ticket on Developer Community.
[regression] [worked-in:17.9] Since updating to Visual Studio 2022 Version 17.10.3 "Suppress" does not show up in the Error List context menu.

Original Comments
Feedback Bot on 6/26/2024, 00:18 PM:
(private comment, text removed)
Original Solutions
(no solutions)
This is a known limitation with LSP not supporting suppression states. In the interim suppression via lightbulb is still a workaround.
PR removing command handler code here: https://github.com/dotnet/roslyn/pull/74266. (NOte the code to actually apply the suppression still exists. if we do an LSP handler here, it would call into that).
I hope these can be fixed before the November release! Using the Light Bulb slows things down.
This is still not showing in v17.12.0
This is still not showing in v17.12.0
This is in the backlog
Closing out as we do not intend on bringing this back based on the low valume of feedback here and high complexity of implementation. 'supress' can be handled through the lightbulb now.
This is disappointing. This just makes this process take longer using the lightbulb.
Keeping this open to gather votes for a little while.
How do we vote "yes PLEASE"? :-)
Thumbs up the main post.
Please restore the previous functionality. Once we upgraded VS 22 from 17.8 to 17.11, our use case (VSTO Add-in for Excel, .NET Framework 4.8, FxCopCmd.exe) is completely broken for Code Analysis:
- All CAnnnn warnings are shown in the VS 22 Error List - even those that have been suppressed in the source code (for example using:
[System.Diagnostics.CodeAnalysis.SuppressMessage ("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]) - the SuppressMessage attributes are being ignored. This makes it very hard to distinguish between previously suppressed issues and new issues. - For any CAnnnn issue shown in the Error List window, there is no longer a right-click (context) menu choice to Suppress. Using the Light-bulb workaround suggested above does not work for us, since that suppresses the IDEnnnn message, not the CAnnnn message (so the latter still shows in the Error List).
It is very frustrating that this functionality has been removed
not the CAnnnn message
This we think is a bug. We are investigating. @ShaunLoganOracle
@ShaunLoganOracle your issue of error list showing suppressed issues was fixed in 17.12. Please try upgrading and let us know if you still see issues.
@arunchndr I upgraded to VS2022 17.12.5 and I still see both issues previously reported:
- Suppressed build CA Warnings are appearing in the error list (screen shot below)
- Right-click menu in Error List does not have the Suppress (in Code) menu item
Does the lightbulb on the item (in source code) have an option to suppress that issue (at the document, or solution level)?
Does the lightbulb on the item (in source code) have an option to suppress that issue (at the document, or solution level)?
No. There is no lightbulb in the left-hand gutter. There is a screwdriver:
If I right-click on the method and choose the light-bulb (Quick Actions and Refactorings), I don't see any option to suppress:
Oh duh. Because it's already suppressed. Brain fart. We will look into why these suppressed items are showing up in the error list. @dibarbet can you ptal?
@ShaunLoganOracle - to confirm, these look like legacy fxcop errors that are produced on build (FxCopCmd.exe), correct? Can you confirm if the output from the "Build" tab reports the suppressed errors in 17.12 (and share a snippet)? I would expect it to not report them.
For example, in my 17.12 instance with a suppression (note no CA1032 reported)
And no error in the error list as expected.
Commenting out the suppression leads to the error being reported.
There's a number of ways errors can be reported, so just trying to track down the source. Thanks!
@dibarbet Yes, those are FxCopCmd.exe build errors. More background in the post above.
Yes, if I change the filter from "Build+Intellisense" to "Build Only" I still see the CA1007 that is suppressed in source via a [SuppressMessage] attribute in the Error List window.
Note also that in the Error List window, the "Code" and "Suppression State" columns are blank for this issue - is that a clue?
VS22:
Yes, if I change the filter from "Build+Intellisense" to "Build Only" I still see the CA1007 that is suppressed in source via a [SuppressMessage] attribute in the Error List window.
To clarify, I meant do you see it in the text output in the "Output" window under the "Build" dropdown? If you could share a small snippet of what you see for an affected project that would be useful
Yes, the CA1007 warning appears both in the Error List window as the previous screen shots show, and also in the Output window with "Build" selected as seen here:
@dibarbet , @CyrusNajmabadi , @arunchndr - is there any progress/update for this? Thanks.
It's being discussed/considered. Thanks
Responding specific to @ShaunLoganOracle's case: The scenario covered there seems to be the legacy analysis via FxCopCmd that is not supported anymore and has since been replaced with source analysis via .NET analyzers which is usable from the SDK or nuget depending on your nuget version. Refer to https://learn.microsoft.com/en-us/visualstudio/code-quality/install-net-analyzers?view=vs-2022
Also see https://learn.microsoft.com/en-us/visualstudio/code-quality/migrate-from-legacy-analysis-to-net-analyzers?view=vs-2022/ for the migration instructions.
Thank you, @arunchndr .
We’d be glad to use the new analyzers, but it is not possible with a VSTO solution. So, until it is a possible to use the new analyzers with a VSTO solution, the old system using FxCopCmd must continue to work.
Roslyn analyzers should still work on netframework.
use the new analyzers, but it is not possible with a VSTO solution
So there seems to be more to this that we need to understand. Would you elaborate on what doesn't work in the vsto+roslyn analyzer combo?
@arunchndr I created a new thread #77609 with details.
It's very disappointing that this feature has gone away, and from a personal point of view I do consider this a bug. It slows working with Code Analysis Suppressions down considerably, especially with big solutions with many projects. The alternative is people disabling rules and this will result in CA being used less and less. I do not understand the audacity of even discussing if a fix should be implemented while in the Feedback Program people clearly do say that they miss the functionality.
When is this going to be put back to the Error Window? This removal (I have no idea why) is causing us to spend a lot more time suppressing code violations. Please put it back for the Novemer release!