I'm currently working on exceptions and I've created a custom exception which implements the parent Exception class.
The problem arises when I try to Serialize or Deserialize such a custom exception.
The error is as follows : "System.Runtime.Serialization.SerializationException: 'Member 'InnerException' was not found.'"
I've referred to many sources on the internet, but was not able to fix the issue. I'm attaching the code with this body.
Thanks in Advance!!!
CodePudding user response:
The common language runtime throws SerializationException if any type in the graph of objects being serialized does not have the SerializableAttribute attribute applied.
Here: https://docs.microsoft.com/en-us/dotnet/api/system.serializableattribute?view=net-6.0#remarks
Try removing the SerializableAttribute