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?
Asked
Active
Viewed 1,063 times
1 Answers
1
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
- 47,787
- 8
- 93
- 120
-
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 Is Fiddling By Firelight Dec 10 '09 at 21:51
-
Cool, that will do the trick then: just pop `#pragma warning disable 1591` atop your class declaration and all's well. – Jeff Sternal Dec 10 '09 at 22:08