当前位置:Gxlcms > 数据库问题 > WCF Failed to invoke the service. Possible causes: The service is offline or inaccessible

WCF Failed to invoke the service. Possible causes: The service is offline or inaccessible

时间:2021-07-01 10:21:17 帮助过:3人阅读

技术分享

最后检查,导致此错误的原因是
[DataContract]
    public class Student
    {
        [DataMember]
        public int PersonId { get; }
        [DataMember]
        public string Name { get; set; }
        
    }
    
    改成如下就好了:
    [DataContract]
    public class Student
    {
        [DataMember]
        public int PersonId { get;private set; }
        [DataMember]
        public string Name { get; set; }
        
    }
    
   wcf 服务序列化只读属性会出现问题,导致Failed to invoke the service.

 

WCF Failed to invoke the service. Possible causes: The service is offline or inaccessible

标签:

人气教程排行