how to disable datasources file generation when updating the WCF service reference in Visual Studio 2010 RRS feed

  • Question

  • Hi,

       I have a wcf service with basichttp binding and I am using the same in my client code by Adding the service reference. When I am trying to update the service reference, the datasource files for the data contracts are getting generated automatically. Is there a way to control this behavior?

    I don't want to use SVCUtil.exe to manually generate the reference.cs file as we have a big team of developers and I want to avoid any manual mistakes. 



    Thanks and Regards Sandeep

    Wednesday, June 24, 2015 2:00 PM


  • Hi Sandeep,
       As per this case, you can try like below:

    In the Service Reference Settings view you can check or uncheck the "Reuse types in referenced assemblies" checkbox or specify the only referenced assemblies to search with the Reuse types in specified referenced assemblies radio button

    "Reuse types in referenced assemblies" only allows you to reuse Data Contracts

    In order to avoid generation of classes in the proxy that is generated by WCF's Add Service Reference we need to add reference to the DLL which include those classes in the client assembly. Another way to do that is to use the svcutil.exe with the parameter /reference:<file path> were file path is the location of the DLL which you want to reuse its classes.

    Thursday, June 25, 2015 3:39 AM