An existing connection was forcibly closed by the remote host

后端 未结 12 2053
说谎
说谎 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:55

    Simple solution for this common annoying issue:

    Just go to your ".context.cs" file (located under ".context.tt" which located under your "*.edmx" file).

    Then, add this line to your constructor:

    public DBEntities() 
            : base("name=DBEntities") 
        { 
            this.Configuration.ProxyCreationEnabled = false; // ADD THIS LINE !
        }
    

    hope this is helpful.

提交回复
热议问题