Troubleshooting with Roslyn

Is there a way to quell problems with Roslyn analysts? I use the project type of an instant analyzer analyzer. And I want to suppress problems if the user wants to. It must also be permanent. If I open Visual Studio again, the same suppression rules should still apply.

+2
source share
2 answers

You can ignore warnings / errors from Roslyn parsers in the same way that you ignore normal C # compiler warnings:

  • #pragma disable in source code
  • Setting project / assembly / error and warning properties
+3
source

Visual Studio 2017 Roslyn (, IDE0002, IDE0003 ..) :

Screenshot

csproj, :

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <NoWarn>IDE0002;1701;1702;1705</NoWarn>
  </PropertyGroup>

, IDE ( , Roslyn). . , .

Pragma -, , - VS ( , ).
, #pragma warning disable IDE0002 Roslyn, ( ).

+2

Source: https://habr.com/ru/post/1683910/


All Articles