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>