2015-07-10 152 views
0

我正在研究一種工具,當我們的xsd模式文件更改時自動更新我們輸入的數據集。我注意到,當我將一個xsd文件添加到Visual Studio並在設計視圖中打開它時,如果我更改屬性並保存,則xsd文件會發生實質性更改。基本上,很多註釋都添加到每個元素。例如:在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

VisualStudio會按照它認爲合適的方式重寫XSD,WSDL或任何XML文件。很多是告訴設計視圖如何顯示數據。那些額外的東西只不過是VS的額外數據而已。

+0

謝謝,我想我想要做的就是讓visual studio重寫xsd on命令,而不必手動打開/關閉IDE中的文檔。 – AJAX86