Disable warnings for automatically generated code / folder / namespace

I like to have clean "0 warnings" - projects in C #. This includes my project with XML comments for each public property and class.

Now I use the entity structure with migrations (code first). Migrations are created using Add-Migration, which causes code to be automatically generated in the Migrations folder (standard behavior). I may need / need to modify these classes a bit, but I do not want to add comments for the public classes created there.

I know that I can turn off warnings with #pragma disable, but again I do not want to do this for each migration class.

So: is it possible to use #pragma disable(or something similar) in a full folder or namespace?

I don't want to use something like GhostDoc as a workaround.

+4
source share
1 answer

To suppress warnings for generated code in a project

  • Right-click the project in Solution Explorer, and then click Properties.
  • Select Code Analysis.
  • Check the Suppress generated code results box.

Help: A practical guide. Suppress code analysis warnings for generated code

+1
source

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


All Articles