An existing connection was forcibly closed by the remote host

后端 未结 12 2112
说谎
说谎 2020-11-22 09:26

I am working with a commercial application which is throwing a SocketException with the message,

An existing connection was forcibly closed by the rem

12条回答
  •  佛祖请我去吃肉
    2020-11-22 09:46

    I've got this exception because of circular reference in entity.In entity that look like

    public class Catalog
    {
        public int Id { get; set; }
        public int ParentId { get; set; }
        public Catalog Parent { get; set; }
        public ICollection ChildCatalogs { get; set; }
    }
    

    I added [IgnoreDataMemberAttribute] to the Parent property. And that solved the problem.

提交回复
热议问题