Turning off XML documentation warnings for a file

  • Thread starter Thread starter Edward Diener
  • Start date Start date
E

Edward Diener

If I set an Xml documentation file in Configuration Properties | Build, a
warning is put out for every non-private element in a public class in every
file of my assembly when there is no Xml documentation for the element. Is
there any way to turn off this warning on a file basis ? Occasionally I have
some files in an assembly for which I do not want to include Xml
documentation. There should be a means of eliminating the warnings for those
files.
 
On a file basis, i would guess no it is not possible.
However, you can choose to suppress that specific warning in the scope of
your
project, by just specifying the warning code. I believe the code to be
supressed is
1591.
 
If I set an Xml documentation file in Configuration Properties | Build, a
warning is put out for every non-private element in a public class in every
file of my assembly when there is no Xml documentation for the element. Is
there any way to turn off this warning on a file basis ? Occasionally I have
some files in an assembly for which I do not want to include Xml
documentation. There should be a means of eliminating the warnings for those
files.

Something like the C/C++ directive #pragma warning(disable:number)?
Unfortunately no. You can disable warnings at the project level but not at
the file or code block level.
 
Something like the C/C++ directive #pragma warning(disable:number)?
Unfortunately no. You can disable warnings at the project level but not at
the file or code block level.

I should add that the #pragma warning directive is in the C# 2.0
specification.
 
Dennis Myrén said:
On a file basis, i would guess no it is not possible.
However, you can choose to suppress that specific warning in the scope of
your
project, by just specifying the warning code. I believe the code to be
supressed is
1591.

Thanks, that does work but I was looking for a file by file solution. I will
look for a way to suggest to the Microsoft Visual Studio .NET C# developers
that they add more file specific project options to the command line and
project options.
 
Back
Top