XmlSerializer support for IsDynamicCodeSupported=false (#59386)
* XmlSerializer support for IsDynamicCodeSupported=false
Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly.
These changes were ported from
* https://github.com/dotnet/runtimelab/pull/593
* https://github.com/dotnet/runtimelab/pull/600
Fix #59167
* Fix a bug in XmlSerializer.CanDeserialize when in ReflectionOnly mode.
* Port UAP code for CanDeserialize
* PR feedback
* Add a linker test to ensure linker option '--enable-opt sealer' works when IsDynamicCodeSupported==false.