Search code examples
.netxml-serializationsgen

How does sgen.exe decide which types to generate serializers for?


You can use sgen.exe to create serialization assemblies ahead of time rather than have them created on the fly.

But how does it decide what types to make serializers for? I've tried to switch to using sgen, but it's been telling me that it can't find any applicable types. Is there an attribute you have to add? Or will I need to manually specify the types?


Solution

  • I'd guess this is because the types weren't public - XML serialisation only works with public types.