我的 WCF 服务中有一个数据合同(比如EmployeeView
)。我已经用Serializable
属性装饰了它,并且所有成员都被标记为DataMember
WCF 中的 A 方法正在返回List<EmployeeView>
。当我通过 WCF 测试客户端或 MVC 应用程序执行此方法时,它成功执行,但是在传输结果时它给出了一个错误The underlying connection was closed: The connection was closed unexpectedly
。不是List<EmployeeView>
序列化虽然EmployeeView
被标记为序列化?
进一步补充,如果我执行一个只返回“EmployeeView”的 OperationContract,它会给我不同的错误说,The service is offline or inaccessible; the client-side configuration does not match the proxy
这让事情变得很奇怪,因为其他操作返回字符串等工作正常