Thursday, August 23, 2012

"Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract" While Adding Service Reference in VS2012

Trying to add a service reference in Visual Studio 2012 to Bing Maps SOAP service I got the following error message:


Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract
...

Following Getting “Recursive collection data contract” when referencing a WCF service with a slightly complex method and Visual Studio 2012 Error Reference.svcmap throwing Error I've had to change the "reuse types in referenced assemblies" from "all" to everything except Newtonsoft.JSON and RestSharp.

Might not be something to write home about, but I'm sure I'll forget where it is was in a year or so.

PS. This seems to be VS2012 only issue, VS2010 worked just fine.

13 comments:

  1. Thanks. This helped. Bing services were failing to generate.

    ReplyDelete
  2. Thanks, that's saved me a lot of head scratching

    ReplyDelete
  3. Many thanks! A simple to solve issue, that could have taken a lot of time for me to solve myself

    ReplyDelete
  4. Thanks so much! I thought it was my service and ended up rebuilding it totally, only to find that it was fine all along.

    ReplyDelete
  5. Thank You. This saved me a lot of time.

    ReplyDelete
  6. Thanks! Helped me out :)

    ReplyDelete
  7. "Might not be something to write home about, but I'm sure I'll forget where it is was in a year or so."
    -- nope, it was! Thanks saved me a lot of time.

    ReplyDelete
  8. Thank you. i have solved the my problem by using that way but I have tried on other computer thn it is working fine means there is not chnaged in that Advance setting. Could you have about "'Newtonsoft.Json.Linq.JToken'"???

    ReplyDelete
  9. saving me lots of time! Thanks!! :)

    ReplyDelete

[Due to much spam, comments are now moderated and will be posted after review]

Note: Only a member of this blog may post a comment.