Is there an easy way to make all classes in an assembly serializable instead of putting [Serializable]
manually on top of each class?
I can't use reflection as attributes are static metadata and cannot be added dynamically, and I'm out of ideas how to achieve this.
Why
I'm writing a security library that repeatedly checks state of its classes and throws MemoryInjectionException
if a class has been modified by any external modifications. In order to achieve this I serialize all classes and save the hash of their serialization in a dictionary.
Edit: Ended up using a self-modified version of SharpSerializer