博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C# xsd转C#类(转)
阅读量:7061 次
发布时间:2019-06-28

本文共 2436 字,大约阅读时间需要 8 分钟。

 

第一次听leader说可以直接将xsd转化为类,查了一下xsd命令:

Microsoft (R) Xml Schemas/DataTypes support utility

[Microsoft (R) .NET Framework, Version 4.0.30319.1]
Copyright (C) Microsoft Corporation. All rights reserved.

xsd.exe -

    Utility to generate schema or class files from given source.

xsd.exe <schema>.xsd /classes|dataset [/e:] [/l:] [/n:] [/o:] [/s] [/uri:]

xsd.exe <assembly>.dll|.exe [/outputdir:] [/type: [...]]
xsd.exe <instance>.xml [/outputdir:]
xsd.exe <schema>.xdr [/outputdir:]

     - OPTIONS -

/classes

    Generate classes for this schema. Short form is '/c'.

/dataset

    Generate sub-classed DataSet for this schema. Short form is '/d'.

/enableLinqDataSet

    Generate LINQ-enabled sub-classed Dataset for the schemas provided.  Short f
orm is '/eld'.

/element:<element>

    Element from schema to process. Short form is '/e:'.

/fields

    Generate fields instead of properties. Short form is '/f'.

/order

    Generate explicit order identifiers on all particle members.

/enableDataBinding

    Implement INotifyPropertyChanged interface on all generated types
    to enable data binding. Short form is '/edb'.

/language:<language>

    The language to use for the generated code. Choose from 'CS', 'VB', 'JS',
    'VJS', 'CPP' or provide a fully-qualified name for a class implementing
    System.CodeDom.Compiler.CodeDomProvider. The default language
    is 'CS' (CSharp). Short form is '/l:'.

/namespace:<namespace>

    The namespace for generated class files. The default namespace
    is the global namespace. Short form is '/n:'.

/nologo

    Suppresses the banner.

/out:<directoryName>

    The output directory to create files in. The default
    is the current directory. Short form is '/o:'.

/type:<type>

    Type from assembly to generate schema for. Multiple types may be provided.
    If no types are provided, then schemas for all types in an assembly
    are generated. Short form is '/t:'.

/uri:<uri>

    Uri of elements from schema to process. Short form is '/u:'.

     - ADVANCED -

/parameters:<file>

    Read command-line options from the specified xml file. Short form is '/p:'.

     - ARGUMENTS -

<schema>.xsd       Name of a schema containing elements to import.
<assembly>.dll|exe Name of an assembly containing types to generate schema for.
<instance>.xml     Name of an xml file to infer xsd schema from.
<schema>.xdr       Name of an xdr schema to convert to xsd.
Multiple file arguments of the same type may be provided.

 

常用格式 xsd /c + xsd文件名 + /l: + 语言(默认C#)+ /o: + 输出路径

转载于:https://www.cnblogs.com/xmyy/archive/2012/12/27/2835440.html

你可能感兴趣的文章
SLG手游Java服务器的设计与开发——网络通信
查看>>
spring-xml版本AspectJ环绕通知
查看>>
bootstrap-导航(垂直堆叠带分隔线的导航)
查看>>
安装tomcat-7.0.61图文
查看>>
游戏程序员的学习指南(必看)(二)
查看>>
手把手教你如何建立自己的Linux系统(LFS速成手册)
查看>>
初识 sqlite 与 content provider 学习笔记
查看>>
java--ftp的断点上传和断点下载
查看>>
11.SSH整合
查看>>
PowerShell记录脚本运行过程
查看>>
OpenSUSE下启动ssh和samba服务以及防火墙设置
查看>>
linux nethogs查看进程流量
查看>>
pip 安装报utf-8错解决办法
查看>>
django 中form在html中的简单使用
查看>>
lync 2013标准版安装
查看>>
【C#】在主线程中取消任务的运行方式
查看>>
POJ-2715(Water)
查看>>
防止集群多节点存储访问方法
查看>>
菜鸟学习Linux集群之概念篇
查看>>
我的友情链接
查看>>