Creating C # inner classes from XSD.exe

I am writing a library that will take an XML string as input, which will deserialize and do some conversion. The result will be a separate XML file with a different schema.

This internal XML will follow an internal scheme that I do not want to provide to the library user. The schema is defined in the XSD file in my project, in which I use XSD.exe (the one that comes with Visual Studio) to create C # classes.

The problem is that XSD.exe generates public classes. I would like them to be implicit or explicit internal .

Anyway, can I create XSD.exe to create internal classes?

+4
source share
1 answer

No, it will not create internal classes. The output of the XSD.EXE classes is intended for serialization using XMLSerializer . XMLSerializer only supports public classes and, therefore, if the XSD outputs internal classes, serialization will fail.

+5
source

All Articles