Skip to content

在.net 8 中使用CloneUtil.Clone()异常System.NotSupportedException #56

@biu8bo

Description

@biu8bo

在.net8中使用CloneUtil.Clone()克隆对象报System.NotSupportedException异常,BinaryFormatter存在安全漏洞,在.net 8中被废弃,应避免使用(https://learn.microsoft.com/zh-cn/dotnet/standard/serialization/binaryformatter-security-guide)
image

var obj = new TestObj()
{
};
var obj2 = EasyTool.CloneUtil.Clone(obj);
 
[Serializable]
class TestObj
{
}

具体版本

2023.917.1-pre-231010054442

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions