Common WCF Exception : Connection Unexpectedly Closed

后端 未结 12 1016
耶瑟儿~
耶瑟儿~ 2021-02-05 17:19

I have three projects. One is a WCF Services Project, one is a WPF Project, and one is a Microsoft Unit Testing Project. I setup the WCF Services project with a data object th

12条回答
  •  滥情空心
    2021-02-05 18:08

    I've noticed this when using LINQ and calls like Select, Where, etc. without an immediate call to .ToList() or ToArray(). Iterators will get you in trouble. They're not native types that WCF knows how to work with like List, Array, etc. They're of type WhereEnumerable or something. Just keep that in mind when sending back results from NHibernate or Entity Framework. Hope this helps someone. Took me hours to figure out.

提交回复
热议问题