webservice asmx 無法序列化接口 System.Collections.Generic.IList


今天有位同事在方法里加了一個IList<entity> 的返回值,也沒有測試,直接發布,導致了如下錯誤。

 

NotSupportedException: 無法序列化接口 System.Collections.Generic.IList

InvalidOperationException: 反射“entity”時出錯。

InvalidOperationException: 無法反射方法 method name 

InvalidOperationException: 無法處理請求。

InvalidOperationException: 處理請求失敗。

 

最終查下來,web service 不支持這樣的類型返回IList<entity> ,故將其改成 List<entity> 編譯正常返回。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM