Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do we suppress a diagnostic rule for a specific file in editorconfig Visual Studio

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

like image 996
Ben Avatar asked Oct 12 '25 02:10

Ben


1 Answers

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

like image 50
Tikall Avatar answered Oct 14 '25 17:10

Tikall