How to generate .xsd from a .cs using xsd.exe tool?

China☆狼群 提交于 2019-12-08 18:38:10

问题


I have a .cs file that contains a subclass of XTypedElement and IXMetaData. Microsoft has a tool that generates XSD files automatically from managed code, but it doesn't accept .cs files. It only accepts .exe, .dll, .xdr, .xml, and .xsd.

How do I convert my .cs file into a .xsd file with this tool?


回答1:


You first need to compile it into dll or exe file, i.e. .NET assembly, and then use this as an input for xsd.exe

If you want to convert only a specific class, use the following command:

xsd bin\Release\MyAssembly.exe /type:The.FullName.Of.YourType


来源:https://stackoverflow.com/questions/10598531/how-to-generate-xsd-from-a-cs-using-xsd-exe-tool

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!