如何使用 xsd.exe 工具从 .cs 生成 .xsd? [英] How to generate .xsd from a .cs using xsd.exe tool?

查看:45
本文介绍了如何使用 xsd.exe 工具从 .cs 生成 .xsd?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 .cs 文件,其中包含 XTypedElement 和 IXMetaData 的子类.Microsoft 有一个自动生成 XSD 文件的工具 来自托管代码,但它不接受 .cs 文件.它只接受 .exe、.dll、.xdr、.xml 和 .xsd.

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.

如何使用此工具将我的 .cs 文件转换为 .xsd 文件?

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

推荐答案

首先需要将其编译成dll或exe文件,即.NET程序集,然后将其作为xsd.exe的输入

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

这篇关于如何使用 xsd.exe 工具从 .cs 生成 .xsd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆