I've got a DLL that contains some XSD-generated classes. Unfortunately, XSD.exe makes those classes public, which results in "Missing XML comment for publicly visible type or member XYZ" warnings. Plus, I'd rather not expose those classes from my DLL. Is there a way, short of manually editing the generated .cs, to make those classes internal?
The XML Schema Definition (Xsd.exe) tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly.
This is a very short answer which could be expanded to a book.
No, xsd.exe can't do what you want.
However you can use the techniques described in this article to access the XmlCodeExporter class which is part of the framework that generates code from XML schemas. Once this is done, you have a copy of the CodeDOM for the generated code in memory. you can iterate through all the classes in the namespace and set them to internal.
It may be that the effort required to remove this one warning is more than you would like.
Another way to remove the warning is to generate the code in an assembly for which the XML docs are turned off (after all who needs docs for generated code?)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With