Getting “Recursive collection data contract” when referencing a WCF service with a slightly complex method

前端 未结 2 1249
日久生厌
日久生厌 2020-12-06 19:30

If I use only simple methods in my WCF service, everything works fine. However, if I include the following method, a problem occurs:

[OperationContract]
publ         


        
2条回答
  •  南笙
    南笙 (楼主)
    2020-12-06 20:11

    As it turned out, the error was caused by the fact that I had a Microsoft Web API package installed from NuGet, which included Json.NET. After uninstalling this, it works fine.

    This may be the answer for you - if not, look at which other packages you have installed (that you don't need) and remove them.

提交回复
热议问题