4

I am trying to suppress a file in editor config on diagnostic scan.

Below is my code, Can anyone help .

[*.File.cs] generated_code = true

Ben
  • 41
  • 2

1 Answers1

5

This feature was added in VS version 16.5, march 16, 2020, after the question was posted.

I got the following to work after restarting VS, as the UI sometimes holds onto errors detected, even though the .editorconfig says to ignore it. In my /migrations/.editorconfig file:

[*.cs]
generated_code = true

You now have the option to exclude generated files or folders when running analyzers. Create an EditorConfig file and mark the required files or folders as generated with the following syntax:

EditorConfig option to exclude generated files or foldersenter image description here

https://learn.microsoft.com/da-dk/visualstudio/releases/2019/release-notes#exclude-generated-files-folders

Tikall
  • 2,453
  • 25
  • 13