Search code examples
c#visual-studiovisual-studio-2022

How to disable fading unused methods in Visual Studio 2022 17.12.0?


I updated my "Visual Studio Community Edition 2022" to version 17.12.0. Now all code of C# private and protected methods are ugly. Please, see image.

public and private methods appearence

How I can disable it? I want equal appearence for private and public methods in C#.

Here is my settings for fading at TextEditor/C#/Advanced:

here is my "unused settings"

I tried to find a setting that would change the color of the private methods, but I couldn't. I also tried many other themes, but the result was the same. By the way, many good color themes have now started to look much worse. In some of them half of the code is completely grayed out.


Solution

  • Thanks Hans Passant for comment. Solution available at this link: https://developercommunity.visualstudio.com/t/unused-private-member-IDE0051-fading-e/10781612

    To disable the rule for your entire project, add the following to your

    .editorconfig file on root projects alongside “.sln”:

    [*.cs]
    dotnet_diagnostic.IDE0055.severity = none
    dotnet_diagnostic.IDE0052.severity = none
    dotnet_diagnostic.IDE0051.severity = none
    dotnet_diagnostic.IDE0044.severity = none