转载自:http://www.cnblogs.com/chenhuzi/p/4178194.html

今天有位同事在方法里加了一个IList<entity> 的返回值,也没有测试,直接发布,导致了如下错误。

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

InvalidOperationException: 反射“entity”时出错。

InvalidOperationException: 无法反射方法 method name 

InvalidOperationException: 无法处理请求。

InvalidOperationException: 处理请求失败。

最终查下来,web service 不支持这样的类型返回IList<entity> ,故将其改成 List<entity> 编译正常返回。

webservice asmx 无法序列化接口 System.Collections.Generic.IList的更多相关文章

  1. NHibernate无法将类型“System.Collections.Generic.IList<T>”隐式转换为“System.Collections.Generic.IList<IT>

    API有一个需要实现的抽象方法: public IList<IPermission> GetPermissions(); 需要注意的是IList<IPermission>这个泛 ...

  2. 无法将类型为“System.Windows.Controls.SelectedItemCollection”的对象强制转换为类型“System.Collections.Generic.IList`1

    在WPF中DataGrid 选择事件中获取SelectedItems 报错如下 无法将类型为“System.Windows.Controls.SelectedItemCollection”的对象强制转 ...

  3. MVC 无法将类型“System.Collections.Generic.List<AnonymousType#1>”隐式转换为“System.Collections.Generic.IList<Mvc3Modeltest.Models.Movie>”。存在一个显式转换(是否缺少强制转换?))

    1.问题: 2.解决方案:强制指定类型. 解决之.

  4. Web Service接口返回泛型的问题(System.InvalidCastException: 无法将类型为“System.Collections.Generic.List`1[System.String]”的对象强制转换为类型“System.String[]”)

    在使用C#写Web Service时遇到了个很奇怪的问题.返回值的类型是泛型(我用的是类似List<string>)的接口,测试时发现总是报什么无法转换为对象的错误,百思不得其解. 后来在 ...

  5. C# System.Collections.Generic.Dictionary

    using System; using System.Collections.Generic; public class Example { public static void Main() { / ...

  6. using System.Collections.Generic;

    public class CommonClass { public static void ShowInt(int iValue) { //typeof(CommonClass) typeof关键字 ...

  7. C#:system.collections.generic(泛型)

    1. array是一个固定长度的,如果要动态的存储的话就不行了,虽然 System.Collections.ArrayList(),是一个动态的存储的容器,但是没有对存储中的数据进行一个约束,所以非泛 ...

  8. System.Collections.Generic的各容器类的用法

    演示System.Collections.Generic的各容器类的用法. 包括:Dictionary,KeyValuePair,SortedDic tionary,SortedList,HashSe ...

  9. Unity3d:Unknown type 'System.Collections.Generic.CollectionDebuggerView'1

    问题描述:如图,在调试状态下说:Unknown type 'System.Collections.Generic.CollectionDebuggerView'1<ignore_js_op> ...

随机推荐

  1. 字符串解析成easyui-tree的格式

    传入的list: [30 : null : null, 301503 : null : null, 301501 : null : null, 301502 : null : null, 3015 : ...

  2. [LeetCode]题解(python):066-Plus One

    题目来源: https://leetcode.com/problems/plus-one/ 题意分析: 给定一个数组,将数加一,返回新的数组.比如[9,9],返回[1,0,0]. 题目思路: 这道题目 ...

  3. NSNumber与NSInteger的区别

    Objective-C 支持的类型有两种:基本类型 和  类. 基本类型,如同C 语言中的 int 类型一样,拿来就可以直接用. 而类在使用时,必须先创建一个对象,再为对象分配空间,接着做初始化和赋值 ...

  4. MAC Eclipse 快捷键

    MAC Eclipse 快捷键大全备忘: Command + O:显示大纲 Command + 1:快速修复 Command + D:删除当前行 Command + Option + ↓:复制当前行到 ...

  5. 编程的毛病——C++之父访谈

    原文见:http://www.technologyreview.com/InfoTech/17831/  翻译:xeon 11/29/2006 在20世纪的80年代和90年代,Bjarne Strou ...

  6. 安卓开发37:自定义的HorizontalScrollView类,使其pageScroll的时候焦点不选中

    自定义一个HorizontalScrollView类,主要为了让这个HorizontalScrollView不能鼠标点击,不能左右按键,并且没有焦点. public class ImageMoveHo ...

  7. 一旦配置oracle em经验

    对oracle10grac构造em,原本很easy事儿,但它需要一个很长的时间,记录下来.MEMO. 首先,例如,报告了以下错误: [oracle@node1 admin]$ emca -config ...

  8. CentOS下安装两个或多个Tomcat7

    链接地址:http://lcbk.net/tomcat/1407.html 首先安装JDK 安装之前检查下是否已经安装了openJDK,如果已安装,建议用yum remove 卸载掉. [root@b ...

  9. Codeforces 490B Queue【模拟】

    题意还是很好理解的,根据题目给出描述条件然后求出这串QUEUE 我的做法就是用两个数组 before[] 和 after[] 表示 ai 前面的前面的人的学号 和 ai 后面的后面的人的学号 ex[] ...

  10. struts2--配置文件中使用通配符

    struts2的配置文件是 struts.xml.. 在这个配置文件里面可以使用通配符..其中的好处就是,大大减少了配置文件的内容..当然,相应付出的代价是可读性.. 使用通配符的原则是 约定高于配置 ...