今天有位同事在方法里加了一個IList<entity> 的返回值,也沒有測試,直接發布,導致了如下錯誤。
NotSupportedException: 無法序列化接口 System.Collections.Generic.IList
InvalidOperationException: 反射“entity”時出錯。
InvalidOperationException: 無法反射方法 method name
InvalidOperationException: 無法處理請求。
InvalidOperationException: 處理請求失敗。
最終查下來,web service 不支持這樣的類型返回IList<entity> ,故將其改成 List<entity> 編譯正常返回。