Disable "Missing XML Documentation" Warnings for WCF RIA Services
Every project should be well documented and Visual Studio has the option to enforce XML code documentation by generating warnings when there is a comment missing, a parameter description missing and such. It can be enabled per project by enabling XML documentation file option on the Build tab.
There are however cases, when it is not necessary for XML docs to be present.
If so, C# has the #pragma keyword. In a single file you can use it as shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
But what if the warning comes from a generated file? #pragma is not an option because the file is likely to be
overwritten in the future (next build?). Quoc Lam has posted about this on his blog. His method is working
for auto-generated XAML files but what I needed was disabling warnings in files created by RIA Services.
Simmilarily to Quam’s method it is possible to add an MSBuild target to the project in question, which add
#pragma warning disable
line at the beginning of RIA generated files:
1 2 3 4 5 6 7 8 |
|
For some reason RIA creates those files read-only, hence usage of the attrib tool
Voila, no RIA-related warnings any more coming from the generated files.