The sgen tool used to generate XML serializer assemblies might be configured incorrectly.
The sgen tool gives unexpected results.
The behavior of the sgen tool varies depending on what you have in your
Machine.config file. For example, by default
sgen is supposed to output optimized non-debug code, but that is not always the case.
Adjust your sgen configuration. To get more debugging information, use the
/k flag, which causes
sgen to keep all its temporary generated files, including the source files and command-line option files