我正在开发一种工具,可以在我们的xsd架构文件发生变化时自动更新我们的类型化数据集。我注意到当我将一个xsd文件添加到Visual Studio并在设计视图中将其打开时,如果我更改了一个属性并保存,那么xsd文件会有很大的变化。基本上,每个元素都添加了很多注释。例如:
<xs:element name="EventWeather">
成为以下内容:
<xs:element name="EventWeather" msprop:Generator_TableClassName="EventWeatherDataTable" msprop:Generator_TableVarName="tableEventWeather" msprop:Generator_RowChangedName="EventWeatherRowChanged" msprop:Generator_TablePropName="EventWeather" msprop:Generator_RowDeletingName="EventWeatherRowDeleting" msprop:Generator_RowChangingName="EventWeatherRowChanging" msprop:Generator_RowEvHandlerName="EventWeatherRowChangeEventHandler" msprop:Generator_RowDeletedName="EventWeatherRowDeleted" msprop:Generator_RowClassName="EventWeatherRow" msprop:Generator_UserTableName="EventWeather" msprop:Generator_RowEvArgName="EventWeatherRowChangeEvent">
问题是如果没有将这些注释添加到xsd文件中,xsd.exe生成的结果类型化数据集代码不会编译,并且会给出一个错误,指出数据集已经包含其中一个生成类型的定义。我希望能够自动将这些注释添加到xsd文件,而无需在Visual Studio中打开它,但无法找到有关它的任何信息。
有谁知道我如何使用命令行从visual studio中利用这个xsd更新功能?我的xsd文件非常大,因此手动添加这些文件不是一种选择。
答案 0 :(得分:0)
VisualStudio将根据需要重写XSD,WSDL或任何XML文件。很多是告诉设计视图如何显示数据。这些额外的东西只是VS的额外数据,可以用它来实现。