Wednesday, September 9, 2009

WCF - Custom tool error: Failed to generate code for the service reference

Error 240 Custom tool error: Failed to generate code for the service reference 'FooService'.  
Please check other error and warning messages for details. 
C:\Development\SolutionName\ProjectName\Service References\FooService\Reference.svcmap
  • Try "Update Service Reference"
  • Try "Configure Service Reference" and unchecking "Reuse types in referenced assemblies"
  • Try searching through the generated files (.disco, .wsdl, .xsd) for path references that differ from the address set in the step above.
  • Try dropping the entire service reference and adding it again.

4 comments:

  1. Unchecking the re-use types worked fine for me, thanks a lot!

    ReplyDelete
  2. unchecking "Reuse types in referenced assemblies" worked for me , thanks

    ReplyDelete
  3. http://uliasz.com/2011/06/wcf-custom-tool-error-failed-to-generate-code-for-the-service-reference/#comment-1647

    Thanks to the article above.

    In my case, i have this issue with my WPF project in VS.Net 2008. After going through this article, i was realizing that the assembly used in the web service is different version of assembly used on client.

    It works just fine after update assembly on the client.

    ReplyDelete