C# .NET Remoting shows error System.Security.SecurityException. Type System.DelegateSerializationHolder and the types derived from it (such as System.DelegateSerializationHolder) are not permitted to be deserialized at this security level.
When using .NET Remoting you may see the following error:
System.Security.SecurityException.
Type System.DelegateSerializationHolder and the types derived from it (suchas System.DelegateSerializationHolder) are not permitted to be deserialized
at this security level.
System.Runtime.Serialization.SerializationException
A lot of comments on the Internet point to the following to change your security level.
However if this is the first time that you've seen this error it maybe because you've introduced something inadvertantly that breaches the security requirements of the default low security level and it would be safer to remove that issue instead of reducing your security.
For me I found that we'd implemented the INotifyPropertyChanged interface on a class.
This defines the PropertyChanged event, and this then breaks your security model.
/// <summary>
/// Occurs when the value of a property is changed.
/// </summary>
If you don't need this event to be serialized and deserialized then you can mark it as non-serialized.
/// <summary>
/// Occurs when the value of a property is changed.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
Comments
Post a Comment