Pedro Rainho

The important thing is never to stop questioning
posts - 118, comments - 55, trackbacks - 19

Problem generate .CS from .XSD File

Recently I had to generate .cs file from a .xsd file. The command I execute was : "xsd.exe /c /o:C:\outputdir inputfile.xsd /f"  and I get this error:

"Warning: cannot generate classes because no top-level elements with complex type were found."

Ideally, Visual Studio designer should generate all the code for me, but it doesn't :)

After searching I found that my problem was in .XSD file.

VS Designer generates this:

<xs:complexType name="MyType">
    .....
</xs:complexType> 

And this is what should be generated:

<xs:element name="MyTypeName" type="MyType" />
<xs:complexType name="MyType">
    ......
</xs:complexType>

Print | posted on Tuesday, July 31, 2007 8:35 AM

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   

Powered by: