Disabling XML Documentation Warnings in code

I love the idea that Visual Studio warns you about missing XML comments – it pushes you to keep your code clean and documented.

But, it is really annoying in code generated by SPMetal – as soon as you include a class generated with the SPMetal, your Error List window is going to be filled with warnings, yellow exclamation signs and “Missing XML comment for publicly visible type or member…” messages.

Ugly.

warnings

But not if you paste the following code on the very beginning of that class:

//disable XML comments
#pragma warning disable 1591

Now you can reclaim your Error List window Smile