views:

244

answers:

1

I've got several hundred warnings due to missing xml comments from a single DataSet generated from a single .xsd file. Since this is an auto generated file manually editing them isn't a good idea. Is there any way to either disable the warning for the file (CS1591) or put values that will be imported into xml comments into the xsd file?

+1  A: 

The normal way to disable warnings for a class in a particular file is to use the pragma warning preprocessor directive, but as you said, you don't want to manually edit an auto-generated file.

Since these are partial classes, I thought you might be able to disable the warning by creating another file to extend it and applying the directive there, but that doesn't work - pragma directives only apply to the file in which they appear.

I think your only option is to live with the noise or suppress the warning at the project/assembly level (from the project properties 'Build' tab, under 'Errors and warnings')

Jeff Sternal
I'm willing to slap a one liner in, it was inserting hundreds of comments. I'll be creating the .cs files via a batch file and will have to do at least one search/replace exercise anyway before being able to use them (there isn't a way to override the default class name of "NewDataSet" in the code. And what's simply ugly with a single dataset is a breaking problem when importing from multiple xml schemas and having multiple datasets.
Dan Neely
Cool, that will do the trick then: just pop `#pragma warning disable 1591` atop your class declaration and all's well.
Jeff Sternal