Is there any way to conditionally specify EmitDefaultValue at runtime for the DataContractSerializer in .NET? Are there any workarounds?
For example, I am curious whether I could use EmitDefaultValue=false for WCF serialization, but I would like to be able to use EmitDefaultValue=true for XMLs generated for external interfaces, such as print.