views:

68

answers:

1

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?

+2  A: 

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?)

Oplopanax
Yeah we looked at that too. We ended up writing an awk script that we invoke as part of our build process to augment the generated code with what we need.
womp
Thanks. I'm gonna file this under "more trouble than it's worth", I think.
Mark W