我们有声纳报告说我们项目中的许多类违反了MissingSerializationConstructorRule,但是该类及其基类都没有实现任何 Iserializable 接口,有人知道为什么吗?
例如,声纳说:
public class CommentPage : RmdsPublicationPage, ICommentPage
{
*MissingSerializationConstructorRule
The required constructor for ISerializable is not present in this type.*
public CommentPage()
{
this["COMMENTTXT"] = null;
对应的类在哪里
public class CommentPage : RmdsPublicationPage, ICommentPage
{
public CommentPage()
{
// do something
}
public void Update(string comment)
{
//something else
}
}
两个接口也不实现ISerializable,即
public class RmdsPublicationPage : Dictionary<string, object>, IRmdsPublicationPage
public interface IRmdsPublicationPage : IDictionary<string, object>, IDisposable