Cannot generate classes because no top-level elements with complex type where found

后端 未结 2 1831
后悔当初
后悔当初 2021-01-04 23:03

I am trying to create a class from a xsd file using the XSD.EXE tool. but for some reason i get this error.

Warning: cannot generate classes because n

2条回答
  •  情书的邮戳
    2021-01-04 23:52

    It would be better to use SvcUtil.exe instead of xsd.exe. It will allow you to avoid the problem with generating classes based on types-only XSDs. An example of .bat file:

    "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\SvcUtil.exe MySchema.xsd TypesSchema.xsd /dconly /n:*,MyNamespace
    pause
    

提交回复
热议问题