我已經花了一些時間弄清楚爲什麼我得到以下信息:基礎連接被關閉
The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
我發現了,我得到每當web服務試圖發送一個屬性此消息與確實有一個基本的get/set。
例子:
public string Name {get;set;} //Works without problems
public string Name { get { return "test"; } } //Fails
起初嘗試它給了我下面的錯誤:
The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
如果我再次嘗試它,它給了我下面的錯誤:
An error occurred while receiving the HTTP response to http://localhost/webapi3/ProductData.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
在我的追蹤記錄我發現以下錯誤:No set method for property 'test' in type 'PS.Converter.ApiModel.DefaultBase'
這是否意味着一個屬性在使用WCF時必須始終有一個集合?或者這是一些可配置的方式?
看到這一點:http://stackoverflow.com/q/2323277/201088 – 2013-03-05 08:40:17