Is there any way to suppress the issues from the Roslyn Analyzers? I use the instant analyzer project type. And I want to suppress the issues if the user wants it. Also it must be permanent. If I reopen Visual Studio, the same suppression rules must still be applied.
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
In Visual Studio 2017 you can disable Roslyn warnings (like IDE0002, IDE0003, etc.) in project properties:
You can directly edit csproj file if neccessary:
As you can see you need to write it with IDE prefix (exactly as it is reported by Roslyn). You have to do that for each build configuration. I think it is fastest and most clear way to disable it for whole project.
Pragma works a bit different most likely due to a bug in VS (so I guess it can be changed later).
For example
#pragma warning disable IDE0002
will not show Roslyn messages but it will still highlight code (more grayed).You can ignore warnings/errors from Roslyn analyzers in exactly the same ways as ignoring normal C# compiler warnings:
#pragma disable
within source code[SuppressMessage]
attribute