Suppress generated code results

I have a project created with the Suppress Results from Generated Code option checked by its properties. When I add a link to the service, the proxy class (reference.cs), which is auto-generated, adds the following attribute:

[System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")]

When I compile in release mode, since I turned on the generation of xml comments, I get warnings, since none of the proxy methods are commented out. As far as I understand, I should not do this, since I have suppression of auto-generated code.

In addition, the reference.cs class is not clscompliant.

Does anyone have an idea how to solve this problem without using pragma disable / enable?

Thanks in advance.

+3
source share
1 answer

The Suppress Generated Code Results option is for code analysis only. To suppress warnings from the compiler, you will need to disable pragma.

+3
source

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


All Articles