How to disable warning as error for generated files only? (MSBuild)

On our continuous integration server (Teamcity 5.1.3), we have an msbuild script that automatically creates our applications.

When we turn on “Warning as an error”: in Visual Studio it builds fine (it ignores the methods in the “* .designer.cs” files, but on the build server we always get the following error:

[(Rebuild target(s)):] somefile.Designer.cs(XX, XX): error CS1591: Warning as Error: Missing XML comment for publicly visible type or member...

The MSBuild script used is as follows:

<MSBuild Projects="proj\$(ProjectName).sln"
         Targets="Clean;Rebuild"
         Properties="Configuration=Release"
         StopOnFirstFailure="True">
</MSBuild>

I can understand why this is so, but should there be a way to tell msbuild to ignore the missing comments in the generated files?

EDITED

: Visual Studio " ", 1591, " ". MSBuild, , " " . ?

EDITED , MSBuild ( "ANY CPU" 1591). , 1591, . , .

+5
3

, MSBuild XML. , . - StyleCop. , , Windows Forms.

- , , . , do-not-edit, Mumble.Designer.cs, [GeneratedCode]. .

, . , Microsoft, . , , .

.

+3

, msbuildcall : nowarn = "1591,1573".

<MSBuild Projects="proj\$(ProjectName).sln"
     Targets="Clean;Rebuild"
     Properties="Configuration=Release;nowarn=1591,1573"
     StopOnFirstFailure="True">
</MSBuild>
+2

For me, the problem went only in the dll project with a link to the SOAP service. When I opened the project settings in the "Embedded" tab, I noticed that the "XML Documentation File" checkbox is checked. This caused every exponential participant in the SOAP service to have a comment!

This checkbox enforces / doc option in my build settings

0
source

All Articles