简体   繁体   English

xsd.exe生成的DataSet类会生成大量警告

[英]DataSet Classes generated by xsd.exe generate a huge number of warnings

I've got several hundred warnings due to missing xml comments from a single DataSet generated from a single .xsd file. 由于缺少从单个.xsd文件生成的单个DataSet的xml注释,我收到了数百条警告。 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? 有什么方法可以禁用文件警告(CS1591),也可以将将要导入xml注释的值放入xsd文件中?

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. 禁用特定文件中类警告的通常方法是使用pragma warning预处理器指令,但是正如您所说,您不想手动编辑自动生成的文件。

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') 我认为您唯一的选择是忍受噪音或在项目/装配体级别抑制警告(从项目属性“构建”选项卡的“错误和警告”下)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM