Pages

Ads 468x60px

Social Icons

Featured Posts

Search

WCF Custom tool error: Failed to generate code for the servicereference.

Thursday, 23 June 2011

Very recently, building multi-tier application involving Silverlight front-end inter-operating with WCF back-end, I encountered very odd, yet annoying behaviour of Visual Studio 2010. I was building new functionality using Telerik RadMap for Silverlight control that was to display some spartial data supplied by WCF service. To achieve this my Silverlight application had to reference few Telerik assemblies (Telerik.Windows.Controls.DataVisualization.dll). What is important is fact, that Service Reference for WCF service had been there already, project built and everything was working nicely, until I added extra method to WCF. After using "Update Service Reference" VS command, I started getting following error.

WCF error Screenshot no.1

Lack of further details with regards to this error and appropriate feedback from Visual Studio certainly does not help to get to the bottom of the problem, however after some investigation it turned out that one of Telerik assemblies caused this problem. When VS2010 creates service reference, default settings are that it should "reuse" all available types in reference. Excluding certain types from serialization allows service reference to be added successfully.

WCF error screen 2

I hope this helps anybody who got stuck with this problem.

19 comments

  1. Tank You it's Works. TANK YOU

    ReplyDelete
  2. Back in school, I'm doing so much laenirng.

    ReplyDelete
  3. Thanks for the post, worked for me!

    ReplyDelete
  4. You're a lifesaver. Thank you!

    ReplyDelete
  5. Awesome.. this worked for me .. Thanks :)

    ReplyDelete
  6. That didnt work for me.
    I do not use the Telerik.Windows.Controls.DataVisualization dll and get the error.
    Are there other solutions?

    ReplyDelete
  7. This can happen with other assemblies. I ran into this problem when upgrading from framework 4.0 to 4.5/

    ReplyDelete
  8. This also happened for the Newtonsoft.JSON assembly. There should be a warning in the error list that tells you which assembly is causing the issue

    ReplyDelete
  9. Beware about the dlls versions too.
    I've lost many hours until guess the SharpArch dll version in the client was different of the version in the WCF Service.
    Excluding this assembly from reuse, everything runs good.
    Thanks for help!

    ReplyDelete
  10. Matt... I love you. You saved me.....thanks

    ReplyDelete
  11. Great!

    I thought, that this is gonna be my personal „End of the World“. :-)

    Thank you for your Post it saved me the evening.

    Regards
    Marcel

    ReplyDelete
  12. Thank you so much Matt.
    But a question here is why this time I get this error? Im always using Telerik controls. How did you know the problem is Telerik.Windows.Controls.DataVisualization.dll

    ReplyDelete
  13. Thanks for this useful article.

    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
  14. Thanks it's work !

    For me I just unchecked "Oracle.DataAccess"

    ReplyDelete
  15. Thank you.

    That fixed about 15 warnings and a few errors, compiles fine now.

    ReplyDelete
  16. that didn't work for me .
    i m having visual studio 2013 and 4.5
    i m unable to get Telerik.Windows.Controls.DataVisualization and i have unchecked Newtonsoft.JSON also but it is not working for me

    please help me on this

    ReplyDelete
  17. Good post. I'm experiencing many of these issues
    as well..

    ReplyDelete

 

Most Popular